From 3e0d4d1f7b6915954663f679eb4dbd12f4350e4f Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 9 Jun 2015 16:48:58 +0200 Subject: [PATCH] Fixed Rattan Chair position, doAnimation before moving player --- addons/sitting/CfgVehicles.hpp | 2 +- addons/sitting/functions/fnc_sit.sqf | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/sitting/CfgVehicles.hpp b/addons/sitting/CfgVehicles.hpp index f46469616f..a2e5a624e8 100644 --- a/addons/sitting/CfgVehicles.hpp +++ b/addons/sitting/CfgVehicles.hpp @@ -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 { diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index b144653d02..32e1c45b40 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -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