mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-23 16:40:50 +03:00
Consolidate duplicate sell distance variables
This commit is contained in:
@@ -64,15 +64,7 @@ if (_finished) then {
|
||||
|
||||
_canAfford = false;
|
||||
if(_bos == 1) then {
|
||||
|
||||
_distance = dayz_sellDistance_vehicle;
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_distance = dayz_sellDistance_air;
|
||||
};
|
||||
if (_part_in isKindOf "Ship") then {
|
||||
_distance = dayz_sellDistance_boat;
|
||||
};
|
||||
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], _distance]);
|
||||
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance]);
|
||||
if (_count >= _qty_in) then {
|
||||
_canAfford = true;
|
||||
};
|
||||
@@ -141,18 +133,9 @@ if (_finished) then {
|
||||
} else {
|
||||
format[localize "str_epoch_player_183",_textPartOut] call dayz_rollingMessages;
|
||||
};
|
||||
} else {
|
||||
|
||||
//sell
|
||||
_distance = dayz_sellDistance_vehicle;
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_distance = dayz_sellDistance_air;
|
||||
};
|
||||
if (_part_in isKindOf "Ship") then {
|
||||
_distance = dayz_sellDistance_boat;
|
||||
};
|
||||
|
||||
_objects = nearestObjects [(getPosATL player), [_part_in], _distance];
|
||||
} else {
|
||||
//sell
|
||||
_objects = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
|
||||
//diag_log format["DEBUG vehicle sell objects: %1", _objects];
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ _bos = 0;
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_vehicle];
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
_qty = count _obj;
|
||||
_bos = 1;
|
||||
};
|
||||
@@ -71,7 +71,7 @@ if (_qty >= _qty_in) then {
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_vehicle];
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
_qty = count _obj;
|
||||
};
|
||||
|
||||
|
||||
@@ -68,15 +68,7 @@ if (_finished) then {
|
||||
|
||||
_canAfford = false;
|
||||
if(_bos == 1) then {
|
||||
|
||||
_distance = dayz_sellDistance_vehicle;
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_distance = dayz_sellDistance_air;
|
||||
};
|
||||
if (_part_in isKindOf "Ship") then {
|
||||
_distance = dayz_sellDistance_boat;
|
||||
};
|
||||
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], _distance]);
|
||||
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance]);
|
||||
if (_count >= _qty_in) then {
|
||||
_canAfford = true;
|
||||
};
|
||||
@@ -149,18 +141,9 @@ if (_finished) then {
|
||||
} else {
|
||||
format[localize "str_epoch_player_183",_textPartOut] call dayz_rollingMessages;
|
||||
};
|
||||
} else {
|
||||
|
||||
} else {
|
||||
//sell
|
||||
_distance = dayz_sellDistance_vehicle;
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_distance = dayz_sellDistance_air;
|
||||
};
|
||||
if (_part_in isKindOf "Ship") then {
|
||||
_distance = dayz_sellDistance_boat;
|
||||
};
|
||||
|
||||
_objects = nearestObjects [(getPosATL player), [_part_in], _distance];
|
||||
_objects = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
|
||||
//diag_log format["DEBUG vehicle sell objects: %1", _objects];
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ _bos = 0;
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_boat];
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
_qty = count _obj;
|
||||
_bos = 1;
|
||||
};
|
||||
@@ -76,7 +76,7 @@ if (_qty >= _qty_in) then {
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_boat];
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
_qty = count _obj;
|
||||
};
|
||||
|
||||
|
||||
@@ -68,15 +68,7 @@ if (_finished) then {
|
||||
|
||||
_canAfford = false;
|
||||
if(_bos == 1) then {
|
||||
|
||||
_distance = dayz_sellDistance_vehicle;
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_distance = dayz_sellDistance_air;
|
||||
};
|
||||
if (_part_in isKindOf "Ship") then {
|
||||
_distance = dayz_sellDistance_boat;
|
||||
};
|
||||
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], _distance]);
|
||||
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance]);
|
||||
if (_count >= _qty_in) then {
|
||||
_canAfford = true;
|
||||
};
|
||||
@@ -149,17 +141,8 @@ if (_finished) then {
|
||||
format[localize "str_epoch_player_183",_textPartOut] call dayz_rollingMessages;
|
||||
};
|
||||
} else {
|
||||
|
||||
//sell
|
||||
_distance = dayz_sellDistance_vehicle;
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_distance = dayz_sellDistance_air;
|
||||
};
|
||||
if (_part_in isKindOf "Ship") then {
|
||||
_distance = dayz_sellDistance_boat;
|
||||
};
|
||||
|
||||
_objects = nearestObjects [(getPosATL player), [_part_in], _distance];
|
||||
_objects = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
|
||||
//diag_log format["DEBUG vehicle sell objects: %1", _objects];
|
||||
|
||||
|
||||
@@ -68,15 +68,7 @@ if (_finished) then {
|
||||
|
||||
_canAfford = false;
|
||||
if(_bos == 1) then {
|
||||
|
||||
_distance = dayz_sellDistance_vehicle;
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_distance = dayz_sellDistance_air;
|
||||
};
|
||||
if (_part_in isKindOf "Ship") then {
|
||||
_distance = dayz_sellDistance_boat;
|
||||
};
|
||||
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], _distance]);
|
||||
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance]);
|
||||
if (_count >= _qty_in) then {
|
||||
_canAfford = true;
|
||||
};
|
||||
@@ -145,15 +137,7 @@ if (_finished) then {
|
||||
} else {
|
||||
|
||||
//sell
|
||||
_distance = dayz_sellDistance_vehicle;
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_distance = dayz_sellDistance_air;
|
||||
};
|
||||
if (_part_in isKindOf "Ship") then {
|
||||
_distance = dayz_sellDistance_boat;
|
||||
};
|
||||
|
||||
_objects = nearestObjects [(getPosATL player), [_part_in], _distance];
|
||||
_objects = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
|
||||
//diag_log format["DEBUG vehicle sell objects: %1", _objects];
|
||||
|
||||
|
||||
@@ -24,12 +24,7 @@ _bos = 0;
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_air];
|
||||
} else {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_vehicle];
|
||||
};
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
_qty = count _obj;
|
||||
_bos = 1;
|
||||
};
|
||||
@@ -80,11 +75,7 @@ if (_qty >= _qty_in) then {
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
if (_part_in isKindOf "AIR") then {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_air];
|
||||
} else {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_vehicle];
|
||||
};
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
_qty = count _obj;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user