chessmaster42 / curatorPresets

This is an addon for Arma 3 that provides script presets in Zeus (aka Curator) mode in the Modules screen.
Other
8 stars 2 forks source link

WP dialog assigns WP to previously selected unit #45

Open MiC17 opened 10 years ago

MiC17 commented 10 years ago

This is 3.) of #39 .

This was a tricky one to pinpoint but I think I know the exact circumstances now, so here goes.

When you place a unit in Zeus mode it automatically becomes the selected unit (seection frame etc.) and if you RClick afterwards the resulting MOVE waypoint is assigned to that unit too. However, the WP handler does not seem to understand that spawning also means selecting what was spawned. To reproduce, place a unit and then attempt to give it a special WP; the WP will be assigned to the previously selected unit (or will do nothing, if there is no previous selection). If you deselect the unit in question and then select it again, the problem is fixed (the WP handler now knows that this unit is selected).

chessmaster42 commented 10 years ago

Yeah, this is a side effect of how I figure out what the currently selected group is. This function is the handler that is called when Zeus changes the selected group: https://github.com/chessmaster42/curatorPresets/blob/master/src/addons/curatorPresets_Module/functions/events/fn_OnGroupSelectionChanged.sqf

However the event seems to be only triggered when you purposefully change the selected group. So technically this is a Zeus bug for not triggering the event when a new group is spawned and auto-selected. I may be able to work around this but not sure yet.