mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-18 22:19:54 -04:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user