Core/GameObjects: Skip LoS checks for traps (#23936)
* Core/GameObjects: Skip LoS checks for traps * Core/GameObjects: Fix spells cast by traps missing always * Scripts/Spells: Fix WSG heal buff not healing The WSG green heal buff is now cast by a GameObject so the spell target should be used to calculate the healing, not the GameObject. # Conflicts: # src/server/scripts/Spells/spell_generic.cpp
This commit is contained in:
1 parent
dcd017bbad
commit
2cea40a466
2 files changed
+9
No files matched your search
@@ -1224,6 +1224,14 @@ uint8 GameObject::getLevelForTarget(WorldObject const* target) const
|
||||
if (Unit* owner = GetOwner())
|
||||
return owner->getLevelForTarget(target);
|
||||
|
||||
if (GetGoType() == GAMEOBJECT_TYPE_TRAP)
|
||||
{
|
||||
if (GetGOInfo()->trap.level != 0)
|
||||
return GetGOInfo()->trap.level;
|
||||
if (const Unit* targetUnit = target->ToUnit())
|
||||
return targetUnit->GetLevel();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -465,6 +465,7 @@ struct GameObjectTemplate
|
||||
case GAMEOBJECT_TYPE_CHEST: return chest.losOK == 0;
|
||||
case GAMEOBJECT_TYPE_GOOBER: return goober.losOK == 0;
|
||||
case GAMEOBJECT_TYPE_FLAGSTAND: return flagstand.losOK == 0;
|
||||
case GAMEOBJECT_TYPE_TRAP: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user