mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
correction on var names
This commit is contained in:
@@ -3498,22 +3498,22 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget)
|
|||||||
|
|
||||||
|
|
||||||
// check if the actual target is valid, spell system uses targets.GetUnitTarget(), GetItemTarget(), GetGOTarget() internally.
|
// check if the actual target is valid, spell system uses targets.GetUnitTarget(), GetItemTarget(), GetGOTarget() internally.
|
||||||
Unit* unitTarget = targets.GetUnitTarget();
|
Unit* uTarget = targets.GetUnitTarget();
|
||||||
if (unitTarget && (!unitTarget->IsInWorld() || unitTarget->IsDuringRemoveFromWorld()))
|
if (uTarget && (!uTarget->IsInWorld() || uTarget->IsDuringRemoveFromWorld()))
|
||||||
{
|
{
|
||||||
// fail if the spell has a unit target that is invalid or being removed from the world
|
// fail if the spell has a unit target that is invalid or being removed from the world
|
||||||
delete spell;
|
delete spell;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Item* itemTarget = targets.GetItemTarget();
|
Item* iTarget = targets.GetItemTarget();
|
||||||
if (!itemTarget && (spellInfo->Targets & (TARGET_FLAG_ITEM | TARGET_FLAG_GAMEOBJECT_ITEM)))
|
if (!iTarget && (spellInfo->Targets & (TARGET_FLAG_ITEM | TARGET_FLAG_GAMEOBJECT_ITEM)))
|
||||||
{
|
{
|
||||||
// fail only if the spell requires a specific item or GO item to cast but the bot does not have one
|
// fail only if the spell requires a specific item or GO item to cast but the bot does not have one
|
||||||
delete spell;
|
delete spell;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
GameObject* goTarget = targets.GetGOTarget();
|
GameObject* gTarget = targets.GetGOTarget();
|
||||||
if (goTarget && !goTarget->isSpawned())
|
if (gTarget && !gTarget->isSpawned())
|
||||||
{
|
{
|
||||||
// fail if the spell has a GO target that is not spawned or does not exist
|
// fail if the spell has a GO target that is not spawned or does not exist
|
||||||
delete spell;
|
delete spell;
|
||||||
|
|||||||
Reference in New Issue
Block a user