Core/SmartScripts: Code cleanup

(cherry picked from commit f555a67bf850e1a9659c89551d7bb69cc812f161)
This commit is contained in:
jackpoz
2021-03-04 18:17:08 +01:00
committed by Shauren
parent 77ee6dca45
commit 55931b0d92
+12 -16
View File
@@ -3125,14 +3125,12 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
//if friendly event&&who is not hostile OR hostile event&&who is hostile
if ((e.event.los.noHostile && !me->IsHostileTo(unit)) ||
(!e.event.los.noHostile && me->IsHostileTo(unit)))
if (!me || !unit)
return;
if (e.event.los.playerOnly && unit->GetTypeId() != TYPEID_PLAYER)
return;
if (e.event.los.playerOnly == TYPEID_PLAYER)
return;
RecalcTimer(e, e.event.los.cooldownMin, e.event.los.cooldownMax);
ProcessAction(e, unit);
{
if (e.event.los.playerOnly && unit->GetTypeId() != TYPEID_PLAYER)
return;
RecalcTimer(e, e.event.los.cooldownMin, e.event.los.cooldownMax);
ProcessAction(e, unit);
}
}
break;
}
@@ -3149,14 +3147,12 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
//if friendly event&&who is not hostile OR hostile event&&who is hostile
if ((e.event.los.noHostile && !me->IsHostileTo(unit)) ||
(!e.event.los.noHostile && me->IsHostileTo(unit)))
if (!me || !unit)
return;
if (e.event.los.playerOnly && unit->GetTypeId() != TYPEID_PLAYER)
return;
if (e.event.los.playerOnly == TYPEID_PLAYER)
return;
RecalcTimer(e, e.event.los.cooldownMin, e.event.los.cooldownMax);
ProcessAction(e, unit);
{
if (e.event.los.playerOnly && unit->GetTypeId() != TYPEID_PLAYER)
return;
RecalcTimer(e, e.event.los.cooldownMin, e.event.los.cooldownMax);
ProcessAction(e, unit);
}
}
break;
}