Alert player on units being reclaimed by enemy#7274
Alert player on units being reclaimed by enemy#7274PexoDev wants to merge 3 commits intobeyond-all-reason:masterfrom
Conversation
| return players | ||
| end | ||
|
|
||
| if gadgetHandler:IsSyncedCode() then |
There was a problem hiding this comment.
I'd imagine that this new "OnReclaim" alert would belong better to Unsynced code, next to UnitDamaged, but I can't get gadget:AllowUnitBuildStep to invoke in the Unsynced section.
I would imagine this has something to do with it belonging to LuaHandleSynced
Would appreciate some guidance here, as this also complicates how to sound this alert only for the owner of the unit, and not the whole team (it'd be inconsistent with other UnitAttacked notifications)
| end | ||
|
|
||
| if GG.notifications and GG.notifications.queueNotification then | ||
| GG["notifications"].queueNotification("UnitsUnderAttack", "teamID", tostring(unitTeamID)) |
There was a problem hiding this comment.
So currently it notifies the whole team, which is clearly unacceptable.
The problem I'm facing is extracting unit ownership here in unsynced context, as AllowUnitBuildStep gets invoked in this context exclusively, and UnitDamaged doesn't trigger for reclaim.
It would be an abysmal waste of procesing to create a dictionary of units ownership for this reason alone, so manual unit ownership tracking is also off the table.
What other options do I have?
Work done
sfx_notifications.luaAddresses Issue(s)
Issue #5428
Test steps
armlab