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.

(cherry picked from commit c8061d8ba6)
This commit is contained in:
offl
2021-09-19 02:15:09 +03:00
committed by Shauren
parent 340091f8ff
commit f55e86d907
3 changed files with 108 additions and 27 deletions
@@ -757,18 +757,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
if (IsUnit(target))
{
if (!e.action.unitFlag.type)
{
target->ToUnit()->AddUnitFlag(UnitFlags(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()->AddUnitFlag2(UnitFlags2(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()->AddUnitFlag(UnitFlags(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;
@@ -779,18 +770,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
if (IsUnit(target))
{
if (!e.action.unitFlag.type)
{
target->ToUnit()->RemoveUnitFlag(UnitFlags(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()->RemoveUnitFlag2(UnitFlags2(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()->RemoveUnitFlag(UnitFlags(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;