Core/SmartScripts: Code cleanup
This commit is contained in:
1 parent
81698da80d
commit
19ce97eae4
1 file changed
+12
-16
@@ -3431,14 +3431,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;
|
||||
}
|
||||
@@ -3455,14 +3453,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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user