Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switchUnits - Fix switching units not working (#6188) #7676

Merged
merged 1 commit into from
Jun 7, 2020

Conversation

McDiod
Copy link
Contributor

@McDiod McDiod commented May 1, 2020

When merged this pull request will:

  • Fix switchUnits functionality

Clicking on a switchable unit currently does nothing (see #6188).

It looks like BIS_fnc_addStackedEventHandler was changed at some point so that the arguments array is appended to onMapSingleClick's passed params, resulting in switchUnits failing here:

https://github.com/acemod/ACE3/blob/master/addons/switchunits/functions/fnc_addMapFunction.sqf#L24

Quick fix would have been:

params ["_pos", "", "", "", "_unit", "_sides"];
if (alive ACE_player && {GVAR(OriginalUnit) getVariable ["ACE_CanSwitchUnits", false]}) then {
    [[_unit,_sides], _pos] call FUNC(handleMapClick);
};

This replaces BIS_fnc_addStackedEventHandler with MapSingleClick mission eventhandler instead and introduces GVAR(switchableSides), because you can't pass arguments through addMissionEventHandler.

@PabstMirror PabstMirror added this to the 3.13.3 milestone Jun 7, 2020
@PabstMirror PabstMirror added the kind/bug-fix Release Notes: **FIXED:** label Jun 7, 2020
@PabstMirror PabstMirror merged commit e25b022 into acemod:master Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-fix Release Notes: **FIXED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants