Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container bugfix #653

Merged
merged 8 commits into from
Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
crlf > lf
  • Loading branch information
DomT602 committed Apr 30, 2020
commit cd348fd85ebdd228022b1fe81d768c4b467c152f
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ indent_style = space
# 1 indent is 4 spaces
indent_size = 4
# Windows-style newlines
end_of_line = crlf
end_of_line = lf
# Set default character encoding
charset = utf-8
# Remove any whitespace characters preceding newline characters
Expand Down
52 changes: 26 additions & 26 deletions life_server/Functions/Housing/fn_houseCleanup.sqf
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
/*
File: fn_houseCleanup.sqf
Author: NiiRoZz
Description:
Cleans up containers inside in house of player.
*/
params [
["_uid","",[""]]
];
private _query = format ["selectHousesCleanup:%1", _uid];
private _houses = [_query,2,true] call DB_fnc_asyncCall;
{
_x params ["_pos"];
_pos = parseSimpleArray _pos;
private _house = nearestObject [_pos, "House"];
private _containers = _house getVariable ["containers",[]];
if !(_containers isEqualTo []) then {
{
deleteVehicle _x;
} forEach _containers;
_house setVariable ["containers",nil,true];
};
} forEach _houses;
/*
File: fn_houseCleanup.sqf
Author: NiiRoZz
Description:
Cleans up containers inside in house of player.
*/
params [
["_uid","",[""]]
];

private _query = format ["selectHousesCleanup:%1", _uid];
private _houses = [_query,2,true] call DB_fnc_asyncCall;

{
_x params ["_pos"];
_pos = parseSimpleArray _pos;
private _house = nearestObject [_pos, "House"];
private _containers = _house getVariable ["containers",[]];

if !(_containers isEqualTo []) then {
{
deleteVehicle _x;
} forEach _containers;
_house setVariable ["containers",nil,true];
};
} forEach _houses;
98 changes: 49 additions & 49 deletions life_server/Functions/Systems/fn_clientDisconnect.sqf
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
#include "\life_server\script_macros.hpp"
/*
File: fn_clientDisconnect.sqf
Author: Bryan "Tonic" Boardwine
Description:
When a client disconnects this will remove their corpse and
clean up their storage boxes in their house. Also, saves player infos & position.
*/
params [
["_unit",objNull,[objNull]],
"",
["_uid","",[""]]
];
if (isNull _unit) exitWith {};
//Save civilian position
if (life_save_civilian_position && {side _unit isEqualTo civilian}) then {
if (isNil "HC_UID" || {!(_uid isEqualTo HC_UID)}) then {
private _position = getPosATL _unit;
if ((getMarkerPos "respawn_civilian" distance _position) > 300) then {
private _alive = alive _unit;
if (life_HC_isActive) then {[_uid,civilian,_alive,4,_position] remoteExec ["HC_fnc_updatePartial",HC_Life]} else {[_uid,civilian,_alive,4,_position] spawn DB_fnc_updatePartial};
};
};
};
if !(alive _unit) then {
diag_log format["%1 disconnected while dead.",_uid];
} else {
{
_x params [
["_corpseUID","",[""]],
["_corpse",objNull,[objNull]]
];
if (_corpseUID isEqualTo _uid) exitWith {
if (isNull _corpse) exitWith {server_corpses deleteAt _forEachIndex};
[_corpse] remoteExecCall ["life_fnc_corpse",0];
diag_log format["%1 disconnected while dead.",_corpseUID];
server_corpses deleteAt _forEachIndex;
};
} forEach server_corpses;
};
private _containers = nearestObjects[_unit,["WeaponHolderSimulated"],5];
{deleteVehicle _x} forEach _containers;
deleteVehicle _unit;
[_uid] call TON_fnc_houseCleanup;
#include "\life_server\script_macros.hpp"
/*
File: fn_clientDisconnect.sqf
Author: Bryan "Tonic" Boardwine

Description:
When a client disconnects this will remove their corpse and
clean up their storage boxes in their house. Also, saves player infos & position.
*/
params [
["_unit",objNull,[objNull]],
"",
["_uid","",[""]]
];
if (isNull _unit) exitWith {};

//Save civilian position
if (life_save_civilian_position && {side _unit isEqualTo civilian}) then {
if (isNil "HC_UID" || {!(_uid isEqualTo HC_UID)}) then {
private _position = getPosATL _unit;
if ((getMarkerPos "respawn_civilian" distance _position) > 300) then {
private _alive = alive _unit;
if (life_HC_isActive) then {[_uid,civilian,_alive,4,_position] remoteExec ["HC_fnc_updatePartial",HC_Life]} else {[_uid,civilian,_alive,4,_position] spawn DB_fnc_updatePartial};
};
};
};

if !(alive _unit) then {
diag_log format["%1 disconnected while dead.",_uid];
} else {
{
_x params [
["_corpseUID","",[""]],
["_corpse",objNull,[objNull]]
];
if (_corpseUID isEqualTo _uid) exitWith {
if (isNull _corpse) exitWith {server_corpses deleteAt _forEachIndex};
[_corpse] remoteExecCall ["life_fnc_corpse",0];
diag_log format["%1 disconnected while dead.",_corpseUID];
server_corpses deleteAt _forEachIndex;
};
} forEach server_corpses;
};

private _containers = nearestObjects[_unit,["WeaponHolderSimulated"],5];
{deleteVehicle _x} forEach _containers;
deleteVehicle _unit;

[_uid] call TON_fnc_houseCleanup;