mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fix house-type object carrying in building (#6049)
This commit is contained in:
parent
b7606800a1
commit
70ca4d01a7
@ -22,11 +22,14 @@ if (!local _this) exitWith {};
|
|||||||
private _hasGravity = simulationEnabled _this && {getText (configFile >> "CfgVehicles" >> typeOf _this >> "simulation") != "house"};
|
private _hasGravity = simulationEnabled _this && {getText (configFile >> "CfgVehicles" >> typeOf _this >> "simulation") != "house"};
|
||||||
|
|
||||||
if (!_hasGravity) then {
|
if (!_hasGravity) then {
|
||||||
private _posAbove = (getPosATL _this) select 2;
|
private _positionASL = getPosASL _this;
|
||||||
TRACE_2("house",_this,_posAbove);
|
// find height of top surface under object
|
||||||
if (_posAbove > 0.1) then {
|
private _surfaces = lineIntersectsSurfaces [_positionASL, ATLToASL [_positionASL select 0, _positionASL select 1, -1], _this];
|
||||||
private _newPosATL = (getPosATL _this) vectorDiff [0, 0, _posAbove];
|
if (_surfaces isEqualTo []) exitWith {};
|
||||||
_this setPosATL _newPosATL;
|
private _surfaceHeight = _surfaces select 0 select 0 select 2;
|
||||||
|
TRACE_2("house",_this,_surfaceHeight);
|
||||||
|
if (_positionASL select 2 > _surfaceHeight + 0.1) then {
|
||||||
|
_this setPosASL [_positionASL select 0, _positionASL select 1, _surfaceHeight];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user