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 6 commits
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
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
10 changes: 5 additions & 5 deletions AL.ini
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ SQL1_1 = SELECT houses.id, houses.pid, houses.pos, players.name, houses.garage F
SQL1_INPUTS = 1
OUTPUT = 1, 2-STRING, 3, 4-STRING, 5

[selectHousesCleanup]
SQL1_1 = SELECT pos FROM houses WHERE pid = ?
SQL1_INPUTS = 1
OUTPUT = 1

[selectHousePositions]
SQL1_1 = SELECT pid, pos FROM houses WHERE pid = ? AND owned = '1'
SQL1_INPUTS = 1
Expand All @@ -214,11 +219,6 @@ SQL1_INPUTS = 1
SQL1_1 = UPDATE houses SET garage = ? WHERE pid = ? AND pos = ?
SQL1_INPUTS = 1, 2, 3

[selectContainerPositions]
SQL1_1 = SELECT pid, pos FROM containers WHERE pid = ? AND owned = '1'
SQL1_INPUTS = 1
OUTPUT = 1-STRING, 2

[selectContainers]
SQL1_1 = SELECT pid, pos, classname, inventory, gear, dir, id FROM containers WHERE pid = ? AND owned = '1'
SQL1_INPUTS = 1
Expand Down
19 changes: 12 additions & 7 deletions life_server/Functions/Housing/fn_houseCleanup.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ params [
["_uid","",[""]]
];

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

{
_x params ["_pos"];
_pos = parseSimpleArray _pos;
{
deleteVehicle _x;
} forEach (nearestObjects[_pos,["Box_IND_Grenades_F","B_supplyCrate_F"],12]);
} forEach _containers;
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;
2 changes: 1 addition & 1 deletion life_server/Functions/Systems/fn_clientDisconnect.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ private _containers = nearestObjects[_unit,["WeaponHolderSimulated"],5];
{deleteVehicle _x} forEach _containers;
deleteVehicle _unit;

[_uid] spawn TON_fnc_houseCleanup;
[_uid] call TON_fnc_houseCleanup;