Scripts/Deadmines: fixed an issue that was causing Molten Slack's fixate to target the Prototype Reaper instead of the other players

* fixed logic for Vanessa's rope summoning
This commit is contained in:
Ovahlord committed 2019-05-16 03:45:51 +02:00
1 parent 09e5cb61a2
commit f01c32aa5b
2 files changed
+9 -7

No files matched your search

@@ -493,11 +493,11 @@ class FixateTargetingCheck
bool operator()(WorldObject* object)
{
if (Unit* unit = object->ToUnit())
if ((unit->GetEntry() == NPC_PROTOTYPE_REAPER && unit->IsCharmedOwnedByPlayerOrPlayer()) || unit->GetTypeId() == TYPEID_PLAYER)
return false;
Unit* target = object->ToUnit();
if (!target)
return true;
return true;
return (target->GetEntry() == NPC_PROTOTYPE_REAPER || target->GetVehicle());
}
};
@@ -556,7 +556,7 @@ class spell_foe_reaper_5000_fixate : public SpellScriptLoader
return ValidateSpellInfo({ SPELL_FIXATE_TAUNT });
}
void HandleHit(SpellEffIndex effIndex)
void HandleHit(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetCaster())
GetHitUnit()->CastSpell(caster, SPELL_FIXATE_TAUNT, true);
@@ -567,8 +567,7 @@ class instance_deadmines : public InstanceMapScript
uint8 i = 0;
if (!_ropeAnchorPairs.empty())
{
std::vector<RopeAnchorPair> _ropeAnchorCopy;
for (auto itr = _ropeAnchorCopy.begin(); itr != _ropeAnchorCopy.end(); itr++)
for (auto itr = _ropeAnchorPairs.begin(); itr != _ropeAnchorPairs.end();)
{
if (!instance->GetCreature(itr->ropeGuid))
{
@@ -581,7 +580,10 @@ class instance_deadmines : public InstanceMapScript
}
}
_ropeAnchorPairs.erase(itr);
itr = _ropeAnchorPairs.begin();
}
else
itr++;
}
}
else