-
Notifications
You must be signed in to change notification settings - Fork 310
Container bugfix #652
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
Open
DomT602
wants to merge
2
commits into
AsYetUntitled:v5.X.X
Choose a base branch
from
DomT602:containerBug
base: v5.X.X
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Container bugfix #652
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,26 @@ | ||
| /* | ||
| File: fn_houseCleanup.sqf | ||
| Author: NiiRoZz | ||
|
|
||
| Description: | ||
| Cleans up containers inside in house of player. | ||
| */ | ||
| params [ | ||
| ["_uid","",[""]] | ||
| ]; | ||
|
|
||
| private _query = format ["SELECT pos FROM containers WHERE pid='%1' AND owned='1'",_uid]; | ||
| private _containers = [_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; | ||
| /* | ||
| File: fn_houseCleanup.sqf | ||
| Author: NiiRoZz | ||
|
|
||
| Description: | ||
| Cleans up containers inside in house of player. | ||
| */ | ||
| params [ | ||
| ["_uid","",[""]] | ||
| ]; | ||
|
|
||
| private _query = format ["SELECT pos FROM containers WHERE pid='%1' AND owned='1'",_uid]; | ||
| private _containers = [_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]); | ||
|
|
||
| private _house = nearestObject [_pos, "House"]; | ||
| if !(_house getVariable ["containers",[]] isEqualTo []) then { | ||
| _house setVariable ["containers",nil,true]; | ||
| }; | ||
| } forEach _containers; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] spawn 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; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.