Core/SAI: Allow update of disable gravity/root applied via static flags (using related action type) (#30481)

This commit is contained in:
Meji
2024-12-04 18:18:02 +01:00
committed by GitHub
parent fa8f2fb273
commit 2cf2535cd6
4 changed files with 5 additions and 12 deletions

View File

@@ -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;

View File

@@ -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)

View File

@@ -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: