add event FRAME_UPDATE in Power prototype for non milti unit units, player, target and etc (aka UNIT_POWER_FREQUENT in retail)

This commit is contained in:
Bunny67
2022-01-23 16:53:19 +03:00
parent 8e5aae8f5a
commit 9465daedd8
2 changed files with 8 additions and 2 deletions
+2
View File
@@ -563,6 +563,8 @@ local function RunTriggerFunc(allStates, data, id, triggernum, event, arg1, arg2
else
arg1 = data.trigger.unit
end
elseif event == "FRAME_UPDATE" and not Private.multiUnitUnits[data.trigger.unit] then
arg1 = data.trigger.unit
end
if arg1 then
if Private.multiUnitUnits[data.trigger.unit] then
+6 -2
View File
@@ -1560,11 +1560,15 @@ Private.event_prototypes = {
AddUnitEventForEvents(result, unit, "UNIT_DISPLAYPOWER")
AddUnitEventForEvents(result, unit, "UNIT_HAPPINESS")
AddUnitEventForEvents(result, unit, "UNIT_NAME_UPDATE")
if trigger.use_ignoreDead or trigger.use_ignoreDisconnected then
AddUnitEventForEvents(result, unit, "UNIT_FLAGS")
end
if unit and not Private.multiUnitUnits[unit] then
if not result.events then
result.events = {}
end
tinsert(result.events, "FRAME_UPDATE")
end
return result;
end,
internal_events = function(trigger)