Core/Misc: Fix static analysis issues

This commit is contained in:
jackpoz
2017-07-16 18:16:48 +02:00
parent f44956b051
commit 9cf4dd7345
13 changed files with 35 additions and 48 deletions

View File

@@ -1039,8 +1039,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
else
creature->DespawnOrUnsummon(respawnDelay);
}
else if (GameObject* go = target->ToGameObject())
go->SetRespawnTime(respawnDelay);
else if (GameObject* goTarget = target->ToGameObject())
goTarget->SetRespawnTime(respawnDelay);
}
break;
}
@@ -1588,10 +1588,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (IsSmart(creature))
ENSURE_AI(SmartAI, creature->AI())->SetScript9(e, e.action.timedActionList.id, GetLastInvoker());
}
else if (GameObject* go = target->ToGameObject())
else if (GameObject* goTarget = target->ToGameObject())
{
if (IsSmartGO(go))
ENSURE_AI(SmartGameObjectAI, go->AI())->SetScript9(e, e.action.timedActionList.id, GetLastInvoker());
if (IsSmartGO(goTarget))
ENSURE_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, e.action.timedActionList.id, GetLastInvoker());
}
}
break;
@@ -1675,10 +1675,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (IsSmart(creature))
ENSURE_AI(SmartAI, creature->AI())->SetScript9(e, id, GetLastInvoker());
}
else if (GameObject* go = target->ToGameObject())
else if (GameObject* goTarget = target->ToGameObject())
{
if (IsSmartGO(go))
ENSURE_AI(SmartGameObjectAI, go->AI())->SetScript9(e, id, GetLastInvoker());
if (IsSmartGO(goTarget))
ENSURE_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, id, GetLastInvoker());
}
}
break;
@@ -1699,10 +1699,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (IsSmart(creature))
ENSURE_AI(SmartAI, creature->AI())->SetScript9(e, id, GetLastInvoker());
}
else if (GameObject* go = target->ToGameObject())
else if (GameObject* goTarget = target->ToGameObject())
{
if (IsSmartGO(go))
ENSURE_AI(SmartGameObjectAI, go->AI())->SetScript9(e, id, GetLastInvoker());
if (IsSmartGO(goTarget))
ENSURE_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, id, GetLastInvoker());
}
}
break;