diff --git a/eXile.MAPNAME/eXpochVectorBldg/ExileClient_construction_thread.sqf b/eXile.MAPNAME/eXpochVectorBldg/ExileClient_construction_thread.sqf index bea8907..977f096 100644 --- a/eXile.MAPNAME/eXpochVectorBldg/ExileClient_construction_thread.sqf +++ b/eXile.MAPNAME/eXpochVectorBldg/ExileClient_construction_thread.sqf @@ -108,9 +108,9 @@ while {ExileClientConstructionResult isEqualTo 0} do ExileClientConstructionPossibleSnapPositions = []; ExileClientConstructionCurrentSnapToObject = objNull; _position = getPosATL player; - _position set [2, -500]; - _newDirAndUp = [[sin BuildVecYaw * cos BuildVecPitch, cos BuildVecYaw * cos BuildVecPitch, sin BuildVecPitch],[[ sin BuildVecRoll,-sin BuildVecPitch,cos BuildVecRoll * cos BuildVecPitch],-BuildVecYaw] call BIS_fnc_rotateVector2D]; - _vectorDirection = _newDirAndUp select 0; + _position set [2, -500]; + _rotation = (ExileClientConstructionRotation + (getDir player) + 360) % 360; + _vectorDirection = [sin(_rotation), cos(_rotation), 0]; _potentionalSnapObject = cursorTarget; if !(isNull _potentionalSnapObject) then { @@ -133,19 +133,15 @@ while {ExileClientConstructionResult isEqualTo 0} do } else { - _newDirAndUp = [[sin BuildVecYaw * cos BuildVecPitch, cos BuildVecYaw * cos BuildVecPitch, sin BuildVecPitch],[[ sin BuildVecRoll,-sin BuildVecPitch,cos BuildVecRoll * cos BuildVecPitch],-BuildVecYaw] call BIS_fnc_rotateVector2D]; - _vectorDirection = _newDirAndUp select 0; - _vectorUp = _newDirAndUp select 1; - ExileClientConstructionObject setVectorDirAndUp [_vectorDirection,_vectorUp]; _position = ASLtoATL (AGLtoASL (player modelToWorld ExileClientConstructionOffset)); - ExileClientConstructionObject setPosATL _position; - ExileClientConstructionObject attachTo [ExileClientConstructionCurrentSnapToObject,ExileClientConstructionOffset]; + _rotation = (ExileClientConstructionRotation + (getDir player) + 360) % 360; + _vectorDirection = [sin(_rotation), cos(_rotation), 0]; { if (_x distance _position < 1) exitWith { _position = _x; - _newDirAndUp = [[sin BuildVecYaw * cos BuildVecPitch, cos BuildVecYaw * cos BuildVecPitch, sin BuildVecPitch],[[ sin BuildVecRoll,-sin BuildVecPitch,cos BuildVecRoll * cos BuildVecPitch],-BuildVecYaw] call BIS_fnc_rotateVector2D]; - _vectorDirection = _newDirAndUp select 0; + _rotation = (ExileClientConstructionRotation + (getDir ExileClientConstructionCurrentSnapToObject) + 360) % 360; + _vectorDirection = [sin(_rotation), cos(_rotation), 0]; _vectorUp = vectorUp ExileClientConstructionCurrentSnapToObject; ExileClientConstructionIsSnapped = true; };