Skip to content

Commit

Permalink
Merge pull request #253 from Vdauphin/FIX-paradrop_fall
Browse files Browse the repository at this point in the history
FIX: object unload fall under bridge
  • Loading branch information
Vdauphin authored Dec 16, 2016
2 parents ea1aa73 + f80b574 commit 53dcfe9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 33 deletions.
29 changes: 14 additions & 15 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/obj_fall.sqf
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@

private ["_obj","_height","_fall","_xx","_yy"];
private ["_obj","_fall","_pos"];

_obj = _this select 0;
_xx = getPos _obj select 0;
_yy = getPos _obj select 1;
_height = (getPos _obj) select 2;
_fall = 0.09;
while {((getPos _obj) select 2) > 0.1} do
{
_fall = (_fall * 1.1);
_obj setPos [_xx, _yy, _height];
_height = _height - _fall;
//hint format ["%1 - %2", (getPos _obj) select 2,_height];
sleep 0.01;
};
_obj setPos [_xx, _yy, 0];
_obj = _this select 0;
_pos = getPos _obj;
_fall = createVehicle ["Land_PenBlack_F", [_pos select 0, _pos select 1, (_pos select 2) + 0.7], [], 0, "FLY"];
_fall setPosASL getPosASL _obj;
_obj attachTo [_fall,[0,0,0]];

sleep 0.1;

waitUntil {(Velocity _fall select 2) isEqualTo 0};

detach _obj;
_obj setPosASL getPosASL _fall;
deleteVehicle _fall;
18 changes: 8 additions & 10 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/paradrop.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,17 @@ _smoke attachto [_dropped,[0,0,0]];
_chem attachto [_dropped,[0,0,0]];
_dropped attachTo [_chute,[0,0,-0.6]];

waitUntil {sleep 1; (_chute isEqualTo objNull)};
sleep 1;

_pos = getPos _dropped;

if !((_pos select 2) < 1) then {
_chute = createVehicle [_chute_type, [getPosATL _dropped select 0,getPosATL _dropped select 1,(getPosATL _dropped select 2) + 5], [], 0, "FLY"];
if ((Velocity _dropped select 2) > -2) then {
detach _dropped;
deleteVehicle _chute;
_chute = createVehicle [_chute_type, [getPosATL _dropped select 0,getPosATL _dropped select 1,(getPosATL _dropped select 2) + 5], [], 0, "CAN_COLLIDE"];
{_chute disableCollisionWith _x;} foreach [_veh,_dropped];

_dropped attachTo [_chute,[0,0,0]];

waitUntil {sleep 1; (_chute isEqualTo objNull)};
_pos = getPos _dropped;
};

_dropped setPos [_pos select 0,_pos select 1,0];
detach _dropped;
waitUntil {_pos = getPosASL _chute; sleep 1; (_chute isEqualTo objNull)};
detach _dropped;
_dropped setPosASL _pos;
10 changes: 2 additions & 8 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/server_unload.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,10 @@ switch (true) do {
case ((_height < 20) && (_height >= 2)): {
_obj setPos [getpos _obj select 0,getpos _obj select 1,(getpos _obj select 2) -1];
sleep 0.1;
if (_obj isKindOf "Strategic") then {_obj_fall = [_obj] spawn btc_fnc_log_obj_fall;};
_obj_fall = [_obj] spawn btc_fnc_log_obj_fall;
};
case (_height < 2): {
private ["_empty"];
_empty = (getPos _veh) findEmptyPosition [0, (sizeOf typeOf _veh + sizeOf _obj_type)/2 +2, _obj_type];
if (_empty isEqualTo []) then {
_obj_fall = [_obj] call btc_fnc_log_obj_fall;
} else {
_obj setPos _empty;//(_veh modelToWorld [0,-9,-0.2]);_obj setVelocity [0,0,0.1];
};
_obj_fall = [_obj] call btc_fnc_log_obj_fall;
};
};

Expand Down

0 comments on commit 53dcfe9

Please sign in to comment.