Core/Scripts: Simplify code

Partially revert 753e7074d84b5a2e8d3c3e92d25c54bb25ba477e and 12c680f9b1f1068099c3b19443d93d456690ac56 to simplify the code and to only remove GMs from the target list.

(cherry picked from commit f9cfc202e90ded24fe0dcf5d06035d2aab2cf6af)
This commit is contained in:
jackpoz
2020-07-16 22:00:28 +02:00
committed by Carbenium
parent e576ddbb82
commit a3dbf4b088
@@ -1091,8 +1091,11 @@ class spell_sindragosa_s_fury : public SpellScriptLoader
{
targets.remove_if([](WorldObject* obj) -> bool
{
// SPELL_ATTR3_ONLY_TARGET_PLAYERS present on the spell, we can safely cast to Player if not corpse
return obj->GetTypeId() == TYPEID_CORPSE || ASSERT_NOTNULL(obj->ToPlayer())->IsGameMaster();
// remove GMs
if (Player* player = obj->ToPlayer())
return player->IsGameMaster();
return false;
});
_targetCount = targets.size();