Skip to content

ToDo: Cleanup all use of "SwitchWeapon" spam #9129

@PabstMirror

Description

@PabstMirror

e.g.

    while {
        _index < 299 && {currentWeapon _vehicle != _weapon}
    } do {
        _unit action ["SwitchWeapon", _vehicle, _unit, _index];
        _index = _index + 1;
    };

ace_safemode
ace_respawn
ace_weaponselect

helper func https://github.com/acemod/ACE3/blob/5aac4c201aec160f861d96116a10efa2e2f10ad5/addons/common/functions/fnc_getFiremodeIndex.sqf

https://github.com/acemod/ACE3/blob/master/addons/safemode/functions/fnc_unlockSafety.sqf#L66-L72
should be able to be replaced with

    // switch to last mode
    private _index = [_unit, _weapon, _mode] call EFUNC(common,getFiremodeIndex);
    _unit action ["SwitchWeapon", _unit, _unit, _index];

but the original func doesn't seem to work as expected, the "rollover" never happens?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions