Skip to content

Commit 62ab601

Browse files
committed
bool to tinyint
1 parent 9fe1cd2 commit 62ab601

File tree

5 files changed

+62
-47
lines changed

5 files changed

+62
-47
lines changed

life_hc/MySQL/General/fn_updatePartial.sqf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ switch (_mode) do {
5353

5454
case 4: {
5555
private _alive = alive _unit;
56+
if ((getMarkerPos "respawn_civilian" distance _position) < 300) then {
57+
_alive = false;
58+
};
59+
_alive = [0, 1] select _alive;
5660
private _position = getPosATL _unit;
5761
_query = format ["updateCivPosition:%1:%2:%3", _alive, _position, _uid];
5862
};

life_hc/MySQL/General/fn_updateRequest.sqf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ private _uid = getPlayerUID _unit;
2727
private _name = name _unit;
2828
private _side = side _unit;
2929
private _alive = alive _unit;
30+
if ((getMarkerPos "respawn_civilian" distance _position) < 300) then {
31+
_alive = false;
32+
};
33+
_alive = [0, 1] select _alive;
3034
private _position = getPosATL _unit;
3135
_arrested = [0, 1] select _arrested;
3236

life_server/Functions/MySQL/fn_updatePartial.sqf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ switch (_mode) do {
5151

5252
case 4: {
5353
private _alive = alive _unit;
54+
if ((getMarkerPos "respawn_civilian" distance _position) < 300) then {
55+
_alive = false;
56+
};
57+
_alive = [0, 1] select _alive;
5458
private _position = getPosATL _unit;
5559
_query = format ["updateCivPosition:%1:%2:%3", _alive, _position, _uid];
5660
};

life_server/Functions/MySQL/fn_updateRequest.sqf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ private _uid = getPlayerUID _unit;
2525
private _name = name _unit;
2626
private _side = side _unit;
2727
private _alive = alive _unit;
28+
private _alive = alive _unit;
29+
if ((getMarkerPos "respawn_civilian" distance _position) < 300) then {
30+
_alive = false;
31+
};
32+
_alive = [0, 1] select _alive;
2833
private _position = getPosATL _unit;
2934
_arrested = [0, 1] select _arrested;
3035

Lines changed: 45 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,45 @@
1-
#include "\life_server\script_macros.hpp"
2-
/*
3-
File: fn_clientDisconnect.sqf
4-
Author: Bryan "Tonic" Boardwine
5-
6-
Description:
7-
When a client disconnects this will remove their corpse and
8-
clean up their storage boxes in their house. Also, saves player infos & position.
9-
*/
10-
params [
11-
["_unit",objNull,[objNull]],
12-
"",
13-
["_uid","",[""]]
14-
];
15-
if (isNull _unit) exitWith {};
16-
17-
//Save civilian position
18-
if (life_save_civilian_position && {side _unit isEqualTo civilian}) then {
19-
if (isNil "HC_UID" || {!(_uid isEqualTo HC_UID)}) then {
20-
if ((getMarkerPos "respawn_civilian" distance _position) > 300) then {
21-
if (life_HC_isActive) then {[_unit,4] remoteExec ["HC_fnc_updatePartial",HC_Life]} else {[_unit,4] spawn DB_fnc_updatePartial};
22-
};
23-
};
24-
};
25-
26-
if !(alive _unit) then {
27-
diag_log format["%1 disconnected while dead.",_uid];
28-
} else {
29-
{
30-
_x params [
31-
["_corpseUID","",[""]],
32-
["_corpse",objNull,[objNull]]
33-
];
34-
if (_corpseUID isEqualTo _uid) exitWith {
35-
if (isNull _corpse) exitWith {server_corpses deleteAt _forEachIndex};
36-
[_corpse] remoteExecCall ["life_fnc_corpse",0];
37-
diag_log format["%1 disconnected while dead.",_corpseUID];
38-
server_corpses deleteAt _forEachIndex;
39-
};
40-
} forEach server_corpses;
41-
};
42-
43-
private _containers = nearestObjects[_unit,["WeaponHolderSimulated"],5];
44-
{deleteVehicle _x} forEach _containers;
45-
deleteVehicle _unit;
46-
47-
[_uid] spawn TON_fnc_houseCleanup;
1+
#include "\life_server\script_macros.hpp"
2+
/*
3+
File: fn_clientDisconnect.sqf
4+
Author: Bryan "Tonic" Boardwine
5+
6+
Description:
7+
When a client disconnects this will remove their corpse and
8+
clean up their storage boxes in their house. Also, saves player infos & position.
9+
*/
10+
params [
11+
["_unit",objNull,[objNull]],
12+
"",
13+
["_uid","",[""]]
14+
];
15+
if (isNull _unit) exitWith {};
16+
17+
//Save civilian position
18+
if (life_save_civilian_position && {side _unit isEqualTo civilian}) then {
19+
if (isNil "HC_UID" || {!(_uid isEqualTo HC_UID)}) then {
20+
if (life_HC_isActive) then {[_unit,4] remoteExec ["HC_fnc_updatePartial",HC_Life]} else {[_unit,4] spawn DB_fnc_updatePartial};
21+
};
22+
};
23+
24+
if !(alive _unit) then {
25+
diag_log format["%1 disconnected while dead.",_uid];
26+
} else {
27+
{
28+
_x params [
29+
["_corpseUID","",[""]],
30+
["_corpse",objNull,[objNull]]
31+
];
32+
if (_corpseUID isEqualTo _uid) exitWith {
33+
if (isNull _corpse) exitWith {server_corpses deleteAt _forEachIndex};
34+
[_corpse] remoteExecCall ["life_fnc_corpse",0];
35+
diag_log format["%1 disconnected while dead.",_corpseUID];
36+
server_corpses deleteAt _forEachIndex;
37+
};
38+
} forEach server_corpses;
39+
};
40+
41+
private _containers = nearestObjects[_unit,["WeaponHolderSimulated"],5];
42+
{deleteVehicle _x} forEach _containers;
43+
deleteVehicle _unit;
44+
45+
[_uid] spawn TON_fnc_houseCleanup;

0 commit comments

Comments
 (0)