Fixed Rattan Chair position, doAnimation before moving player

This commit is contained in:
jonpas 2015-06-09 16:48:58 +02:00
parent 332afb2174
commit 3e0d4d1f7b
2 changed files with 4 additions and 4 deletions

View File

@ -100,7 +100,7 @@ class CfgVehicles {
MACRO_SEAT_ACTION
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0.07, 0.17, 1};
GVAR(sitPosition[]) = {0, -0.1, -1}; // Z must be -1 due to chair's geometry (magic floating seat point)
};
// Field Toilet
class Land_FieldToilet_F: ThingX {

View File

@ -29,13 +29,13 @@ private ["_sitDirection", "_sitPosition"];
_sitDirection = getNumber (configFile >> "CfgVehicles" >> typeOf _seat >> QGVAR(sitDirection));
_sitPosition = getArray (configFile >> "CfgVehicles" >> typeOf _seat >> QGVAR(sitPosition));
// Get random animation and perform it (before moving player to ensure correct placement)
[_player, call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation);
// Set direction and position
_player setDir ((getDir _seat) + _sitDirection);
_player setPos (_seat modelToWorld _sitPosition);
// Get random animation and perform it
[_player, call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation);
// Set variables
_player setVariable [QGVAR(isSitting), true];
_seat setVariable [QGVAR(seatOccupied), true, true]; // To prevent multiple people sitting on one seat