Core/Misc: don't allow players to use/activate/loot non-allowed gameobjects while under the effect of a damage immunity aura (#23319)

* Core/Misc: don't allow players to use/activate/loot non-allowed gameobjects while under the effect of a damage immunity aura.

* Forgot to change this in last-second rename.

* Apply suggested changes, thanks Shauren!

# Conflicts:
#	src/server/game/Entities/GameObject/GameObject.cpp
#	src/server/game/Entities/Unit/UnitDefines.h
#	src/server/game/Entities/Unit/enuminfo_UnitDefines.cpp
#	src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp
This commit is contained in:
Wyrserth authored and Ovahlord committed 2020-09-11 15:06:15 +02:00
1 parent 1fd66b4621
commit d2b27bc43c
8 files changed
+45 -4

No files matched your search

@@ -486,6 +486,21 @@ struct GameObjectTemplate
}
}
bool CannotBeUsedUnderImmunity() const // Cannot be used/activated/looted by players under immunity effects (example: Divine Shield)
{
switch (type)
{
case GAMEOBJECT_TYPE_DOOR: return door.noDamageImmune != 0;
case GAMEOBJECT_TYPE_BUTTON: return button.noDamageImmune != 0;
case GAMEOBJECT_TYPE_QUESTGIVER: return questgiver.noDamageImmune != 0;
case GAMEOBJECT_TYPE_CHEST: return true; // All chests cannot be opened while immune on 3.3.5a
case GAMEOBJECT_TYPE_GOOBER: return goober.noDamageImmune != 0;
case GAMEOBJECT_TYPE_FLAGSTAND: return flagstand.noDamageImmune != 0;
case GAMEOBJECT_TYPE_FLAGDROP: return flagdrop.noDamageImmune != 0;
default: return false;
}
}
uint32 GetCharges() const // despawn at uses amount
{
switch (type)