Merge pull request #3753 from acemod/blockEngine-statusEffect

Add blockEngine status effect
This commit is contained in:
Glowbal 2016-05-07 22:40:05 +02:00
commit ed9d05d6dd
7 changed files with 35 additions and 7 deletions

View File

@ -76,3 +76,9 @@ class Extended_FiredBIS_EventHandlers {
ADDON = QUOTE(_this call FUNC(firedEH));
};
};
class Extended_Engine_EventHandlers {
class All {
ADDON = QUOTE(_this call FUNC(handleEngine));
};
};

View File

@ -87,6 +87,7 @@ PREP(getWindDirection);
PREP(getZoom);
PREP(goKneeling);
PREP(hadamardProduct);
PREP(handleEngine);
PREP(handleModifierKey);
PREP(handleModifierKeyUp);
PREP(handleScrollWheel);

View File

@ -64,6 +64,7 @@
["blockSprint", false, []] call FUNC(statusEffect_addType);
["setCaptive", true, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered), QEGVAR(medical,unconscious)]] call FUNC(statusEffect_addType);
["blockDamage", false, ["fixCollision"]] call FUNC(statusEffect_addType);
["blockEngine", false, ["ACE_Refuel"]] call FUNC(statusEffect_addType);
["forceWalk", {
params ["_object", "_set"];
@ -90,6 +91,11 @@
_object allowDamage (_set == 0);
};
}] call FUNC(addEventHandler);
["blockEngine", {
params ["_vehicle", "_set"];
_vehicle setVariable [QGVAR(blockEngine), _set > 0, true];
_vehicle engineOn false;
}] call FUNC(addEventHandler);
//Add a fix for BIS's zeus remoteControl module not reseting variables on DC when RC a unit
//This variable is used for isPlayer checks

View File

@ -0,0 +1,19 @@
/*
* Author: BaerMitUmlaut
* Blocks turning on the vehicles engine if set by the status effect handler.
*
* Arguments:
* 0: Vehicle <OBJECT>
* 1: Engine state <BOOL>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["_vehicle", "_engineOn"];
if (local _vehicle && {_engineOn} && {_vehicle getVariable [QGVAR(blockEngine), false]}) then {
_vehicle engineOn false;
};

View File

@ -17,9 +17,7 @@
params [["_target", objNull, [objNull]]];
["setVanillaHitPointDamage", _target, [_target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]] ] ] call EFUNC(common,objectEvent);
_target setVariable [QGVAR(engineHit), nil, true];
[_target, "blockEngine", "ACE_Refuel", false] call EFUNC(common,statusEffect_set);
_target setVariable [QGVAR(isConnected), false, true];
private _nozzle = _target getVariable [QGVAR(ownedNozzle), nil];

View File

@ -48,8 +48,7 @@ if (isNull _nozzle || {_source != _target}) exitWith {false};
};
deleteVehicle _nozzle;
["setVanillaHitPointDamage", _target, [_target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]] ] ] call EFUNC(common,objectEvent);
_target setVariable [QGVAR(engineHit), nil, true];
[_target, "blockEngine", "ACE_Refuel", false] call EFUNC(common,statusEffect_set);
},
"",
localize LSTRING(ReturnAction),

View File

@ -26,8 +26,7 @@ REFUEL_HOLSTER_WEAPON
private _endPosOffset = [0, 0, 0];
if (isNull _nozzle) then { // func is called on fuel truck
_target setVariable [QGVAR(engineHit), _target getHitPointDamage "HitEngine", true];
["setVanillaHitPointDamage", _target, [_target, ["HitEngine", 1]] ] call EFUNC(common,objectEvent);
[_target, "blockEngine", "ACE_Refuel", true] call EFUNC(common,statusEffect_set);
_target setVariable [QGVAR(isConnected), true, true];
_endPosOffset = getArray (configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hooks));