Added isNotSitting exception, Renamed sitting QGVAR

This commit is contained in:
jonpas 2015-06-08 23:39:14 +02:00
parent c6b5c705c7
commit 95ec2ea1f9
5 changed files with 14 additions and 4 deletions

View File

@ -3,3 +3,10 @@ class Extended_PreInit_EventHandlers {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit));
};
};

View File

@ -0,0 +1,3 @@
#include "script_component.hpp"
["isNotSitting", {!((_this select 0) getVariable [QGVAR(isSitting), false])}] call EFUNC(common,addCanInteractWithCondition);

View File

@ -17,5 +17,5 @@
PARAMS_1(_player);
// If sitting
(_player getVariable [QGVAR(sitting),false])
// Sitting
(_player getVariable [QGVAR(isSitting),false])

View File

@ -36,5 +36,5 @@ _player setPos (_seat modelToWorld _sitPosition);
[_player, call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation);
// Set variables
_player setVariable [QGVAR(sitting), true];
_player setVariable [QGVAR(isSitting), true];
_seat setVariable [QGVAR(seatOccupied), true, true]; // To prevent multiple people sitting on one seat

View File

@ -21,6 +21,6 @@ PARAMS_1(_player);
[_player, "", 2] call EFUNC(common,doAnimation);
// Set variables to nil
_player setVariable [QGVAR(sitting), nil];
_player setVariable [QGVAR(isSitting), nil];
GVAR(seat) setVariable [QGVAR(seatOccupied), nil, true];
GVAR(seat) = nil;