Added blockEngine status effect

This commit is contained in:
BaerMitUmlaut 2016-05-03 20:52:43 +02:00
parent 55aa4d08f8
commit e125911c3b
4 changed files with 32 additions and 0 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;
};