aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroffl <offl@users.noreply.github.com>2021-09-19 02:15:09 +0300
committeroffl <offl@users.noreply.github.com>2021-09-19 02:15:09 +0300
commitc8061d8ba620e78c1344ad5f2d476d7d6e5057cb (patch)
treedc104ca6c74dca48bac8fcd531dd1544410df955 /src
parent8a70efed8c56b0b24caa4f449279e75b2375e45f (diff)
Core/SAI: Remove possibility to set/remove unit_flags2
So far I see that only Cannot Turn flag can be changed by scripts and action to change it didn't existed in 3xx. If someone will need to change that flag, it should be implemented by action which will change only that flag and not any flag of that type.
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp30
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h5
2 files changed, 8 insertions, 27 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 251d47de473..7ff4a5a9d46 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -745,18 +745,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
if (IsUnit(target))
{
- if (!e.action.unitFlag.type)
- {
- target->ToUnit()->SetFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag);
- TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit %s added flag %u to UNIT_FIELD_FLAGS",
- target->GetGUID().ToString().c_str(), e.action.unitFlag.flag);
- }
- else
- {
- target->ToUnit()->SetFlag(UNIT_FIELD_FLAGS_2, e.action.unitFlag.flag);
- TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit %s added flag %u to UNIT_FIELD_FLAGS_2",
- target->GetGUID().ToString().c_str(), e.action.unitFlag.flag);
- }
+ target->ToUnit()->SetFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag);
+ TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit %s added flag %u to UNIT_FIELD_FLAGS",
+ target->GetGUID().ToString().c_str(), e.action.unitFlag.flag);
}
}
break;
@@ -767,18 +758,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
if (IsUnit(target))
{
- if (!e.action.unitFlag.type)
- {
- target->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag);
- TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit %s removed flag %u to UNIT_FIELD_FLAGS",
- target->GetGUID().ToString().c_str(), e.action.unitFlag.flag);
- }
- else
- {
- target->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS_2, e.action.unitFlag.flag);
- TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit %s removed flag %u to UNIT_FIELD_FLAGS_2",
- target->GetGUID().ToString().c_str(), e.action.unitFlag.flag);
- }
+ target->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag);
+ TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit %s removed flag %u to UNIT_FIELD_FLAGS",
+ target->GetGUID().ToString().c_str(), e.action.unitFlag.flag);
}
}
break;
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index 46f667417e3..77df54c1a30 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -473,8 +473,8 @@ enum SMART_ACTION
SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS = 15, // QuestID
SMART_ACTION_RESERVED_16 = 16, // used on 4.3.4 and higher scripts
SMART_ACTION_SET_EMOTE_STATE = 17, // emoteID
- SMART_ACTION_SET_UNIT_FLAG = 18, // Flags (may be more than one field OR'd together), Target
- SMART_ACTION_REMOVE_UNIT_FLAG = 19, // Flags (may be more than one field OR'd together), Target
+ SMART_ACTION_SET_UNIT_FLAG = 18, // Flags
+ SMART_ACTION_REMOVE_UNIT_FLAG = 19, // Flags
SMART_ACTION_AUTO_ATTACK = 20, // AllowAttackState (0 = stop attack, anything else means continue attacking)
SMART_ACTION_ALLOW_COMBAT_MOVEMENT = 21, // AllowCombatMovement (0 = stop combat based movement, anything else continue attacking)
SMART_ACTION_SET_EVENT_PHASE = 22, // Phase
@@ -947,7 +947,6 @@ struct SmartAction
struct
{
uint32 flag;
- uint32 type;
} unitFlag;
struct