mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/SAI: Allow update of disable gravity/root applied via static flags (using related action type) (#30481)
This commit is contained in:
@@ -735,11 +735,6 @@ void SmartAI::SetRun(bool run)
|
||||
_run = run;
|
||||
}
|
||||
|
||||
void SmartAI::SetDisableGravity(bool fly)
|
||||
{
|
||||
me->SetDisableGravity(fly);
|
||||
}
|
||||
|
||||
void SmartAI::SetEvadeDisabled(bool disable)
|
||||
{
|
||||
_evadeDisabled = disable;
|
||||
|
||||
@@ -192,8 +192,6 @@ class TC_GAME_API SmartAI : public CreatureAI
|
||||
// Makes the creature run/walk
|
||||
void SetRun(bool run = true);
|
||||
|
||||
void SetDisableGravity(bool disable = true);
|
||||
|
||||
void SetEvadeDisabled(bool disable = true);
|
||||
|
||||
void SetInvincibilityHpLevel(uint32 level)
|
||||
|
||||
@@ -1361,10 +1361,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
}
|
||||
case SMART_ACTION_SET_DISABLE_GRAVITY:
|
||||
{
|
||||
if (!IsSmart())
|
||||
break;
|
||||
|
||||
ENSURE_AI(SmartAI, me->AI())->SetDisableGravity(e.action.setDisableGravity.disable != 0);
|
||||
for (WorldObject* target : targets)
|
||||
if (IsCreature(target))
|
||||
target->ToCreature()->SetFloating(e.action.setDisableGravity.disable != 0);
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_RUN:
|
||||
@@ -2055,7 +2054,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
{
|
||||
for (WorldObject* target : targets)
|
||||
if (IsCreature(target))
|
||||
target->ToCreature()->SetControlled(e.action.setRoot.root != 0, UNIT_STATE_ROOT);
|
||||
target->ToCreature()->SetSessile(e.action.setRoot.root != 0);
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SUMMON_CREATURE_GROUP:
|
||||
|
||||
Reference in New Issue
Block a user