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:
Giacomo Pozzoni authored and Ovahlord committed 2020-09-11 15:12:12 +02:00
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;
}