Skip to content

Commit ed223dc

Browse files
committed
Implement IsAnimTierValid
1 parent 7f59d2e commit ed223dc

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

‎src/server/game/AI/AIGroup/AIGroupMgr.cpp‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,9 @@ bool AIGroupMgr::IsActionValid(ActionSetEventHolder const& action)
432432
if (!IsCreatureValid(action))
433433
return false;
434434

435+
if (!IsAnimTierValid(action))
436+
return false;
437+
435438
if (!IsEmoteValid(action))
436439
return false;
437440

@@ -803,6 +806,29 @@ bool AIGroupMgr::IsCreatureValid(ActionSetEventHolder const& action)
803806
return true;
804807
}
805808

809+
bool AIGroupMgr::IsAnimTierValid(ActionSetEventHolder const& action)
810+
{
811+
switch (AI_GROUP_ACTION(action.Type))
812+
{
813+
case AI_GROUP_TIER_TRANSITION_LAND:
814+
case AI_GROUP_TIER_TRANSITION_TAKE_OFF:
815+
case AI_GROUP_TIER_TRANSITION_MOVETO:
816+
case AI_GROUP_TIER_TRANSITION_MOVETO_GUID:
817+
case AI_GROUP_TIER_TRANSITION_FOLLOW_PATH:
818+
if (action.Extra2 >= uint8(AnimTier::Max))
819+
{
820+
TC_LOG_ERROR("sql.sql", "Table `action_set` (Id: {}, Index: {}) with action type {} uses invalid anim tier {}, skipped.",
821+
action.Id, action.Index, action.Type, uint32(action.Extra2));
822+
return false;
823+
}
824+
break;
825+
default:
826+
break;
827+
}
828+
829+
return true;
830+
}
831+
806832
bool AIGroupMgr::IsEmoteValid(ActionSetEventHolder const& action)
807833
{
808834
switch (AI_GROUP_ACTION(action.Type))

‎src/server/game/AI/AIGroup/AIGroupMgr.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,7 @@ class TC_GAME_API AIGroupMgr
892892
static bool IsSpellValid(ActionSetEventHolder const& action);
893893
static bool IsBroadcastTextValid(ActionSetEventHolder const& action);
894894
static bool IsCreatureValid(ActionSetEventHolder const& action);
895+
static bool IsAnimTierValid(ActionSetEventHolder const& action);
895896
static bool IsEmoteValid(ActionSetEventHolder const& action);
896897
static bool IsSoundValid(ActionSetEventHolder const& action);
897898
static bool IsQuestValid(ActionSetEventHolder const& action);

0 commit comments

Comments
 (0)