Reload/Interaction - Fix 2 hemtt ingame errors (#7924)

* fix 2 hemtt ingame errors

* Extract broken calls to function

* Update addons/interaction/functions/fnc_doRemoteControl.sqf

Co-authored-by: Dystopian <sddex@ya.ru>

Co-authored-by: Dystopian <sddex@ya.ru>
This commit is contained in:
Joko 2020-10-21 18:17:42 +02:00 committed by GitHub
parent 25cc139dba
commit 153644b77a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 56 additions and 22 deletions

View File

@ -35,19 +35,7 @@ class ACE_ZeusActions {
displayName = "$STR_A3_CfgVehicles_ModuleRemoteControl_F"; displayName = "$STR_A3_CfgVehicles_ModuleRemoteControl_F";
icon = "\A3\Modules_F_Curator\Data\portraitRemoteControl_ca.paa"; icon = "\A3\Modules_F_Curator\Data\portraitRemoteControl_ca.paa";
condition = QUOTE(ZEUS_ACTION_CONDITION && {-1 < (curatorSelected select 0) findIf {!isNull effectiveCommander _x}}); condition = QUOTE(ZEUS_ACTION_CONDITION && {-1 < (curatorSelected select 0) findIf {!isNull effectiveCommander _x}});
statement = QUOTE( \ statement = QUOTE(call FUNC(doRemoteControl));
private _units = curatorSelected select 0; \
private _unit = _units param [ARR_2( \
_units findIf { \
side _x in [ARR_4(east,west,resistance,civilian)] \
&& !(isPlayer _x) \
}, \
objNull \
)]; \
bis_fnc_curatorObjectPlaced_mouseOver = [ARR_2('OBJECT',_unit)]; \
private _rc = group _target createUnit [ARR_5('ModuleRemoteControl_F',[ARR_3(0,0,0)],[],0,'NONE')]; \
_rc setVariable [ARR_2('BIS_fnc_initModules_disableAutoActivation',false)]; \
);
}; };
class GVAR(repair) { class GVAR(repair) {

View File

@ -25,6 +25,7 @@ PREP(canPassMagazine);
PREP(passMagazine); PREP(passMagazine);
PREP(canBecomeLeader); PREP(canBecomeLeader);
PREP(doBecomeLeader); PREP(doBecomeLeader);
PREP(doRemoteControl);
PREP(canTapShoulder); PREP(canTapShoulder);
PREP(tapShoulder); PREP(tapShoulder);
PREP(canPardon); PREP(canPardon);

View File

@ -0,0 +1,25 @@
#include "script_component.hpp"
/*
* Author: SilentSpike, joko
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ace_interaction_fnc_onRemoteControl
*
* Public: No
*/
private _units = curatorSelected select 0;
private _index = _units findIf {
(side _x) in [east, west, resistance, civilian]
&& !(isPlayer _x)
};
private _unit = _units param [_index, objNull];
bis_fnc_curatorObjectPlaced_mouseOver = ["OBJECT", _unit];
private _rc = (group _target) createUnit ["ModuleRemoteControl_F", [0,0,0], [], 0, "NONE"];
_rc setVariable ["BIS_fnc_initModules_disableAutoActivation", false];

View File

@ -20,15 +20,7 @@ class Extended_PostInit_EventHandlers {
class Extended_Take_EventHandlers { class Extended_Take_EventHandlers {
class CAManBase { class CAManBase {
class ACE_AmmoIndicatorReload { class ACE_AmmoIndicatorReload {
clientTake = QUOTE( \ clientTake = QUOTE(_this call FUNC(onTake));
params [ARR_3('_unit', '_container', '_item')]; \
if ( \
_unit == ACE_player \
&& {GVAR(DisplayText)} \
&& {_container in [ARR_3(uniformContainer _unit, vestContainer _unit, backpackContainer _unit)]} \
&& {_item == currentMagazine _unit} \
) then {_unit call DFUNC(displayAmmo)}; \
);
}; };
}; };
}; };

View File

@ -4,4 +4,5 @@ PREP(canCheckAmmoSelf);
PREP(getAmmoToLinkBelt); PREP(getAmmoToLinkBelt);
PREP(checkAmmo); PREP(checkAmmo);
PREP(displayAmmo); PREP(displayAmmo);
PREP(onTake);
PREP(startLinkingBelt); PREP(startLinkingBelt);

View File

@ -0,0 +1,27 @@
#include "script_component.hpp"
/*
* Author: ?
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Container <OBJECT>
* 2: Item <STRING>
*
* Return Value:
* None
*
* Example:
* [bob, backpackContainer bob, "ACE_Banana"] call ace_reload_fnc_onTake
*
* Public: No
*/
params ["_unit", "_container", "_item"];
if (
_unit == ACE_player
&& {GVAR(DisplayText)}
&& {_item == currentMagazine _unit}
&& {_container in [uniformContainer _unit, vestContainer _unit, backpackContainer _unit]}
) then {
_unit call FUNC(displayAmmo);
};