Skip to content

Commit 3880598

Browse files
that-edwardBoGuuDomT602
authored
selectRandom and selectMin (#628)
* Update fn_captureHideout.sqf * selectRandom pt.2 * BIS_fnc_lowestNum > selectMin Co-authored-by: Ollie W <boguug@gmail.com> Co-authored-by: DomT602 <32492434+DomT602@users.noreply.github.com>
1 parent 5255a55 commit 3880598

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

Altis_Life.Altis/core/actions/fn_captureHideout.sqf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ if (life_interrupted) exitWith {life_interrupted = false; titleText[localize "ST
8080
life_action_inUse = false;
8181

8282
titleText[localize "STR_GNOTF_Captured","PLAIN"];
83-
private _flagTexture = [
83+
private _flagTexture = selectRandom [
8484
"\A3\Data_F\Flags\Flag_red_CO.paa",
8585
"\A3\Data_F\Flags\Flag_green_CO.paa",
8686
"\A3\Data_F\Flags\Flag_blue_CO.paa",
@@ -89,7 +89,7 @@ private _flagTexture = [
8989
"\A3\Data_F\Flags\flag_fd_green_CO.paa",
9090
"\A3\Data_F\Flags\flag_fd_blue_CO.paa",
9191
"\A3\Data_F\Flags\flag_fd_orange_CO.paa"
92-
] call BIS_fnc_selectRandom;
92+
];
9393
_this select 0 setFlagTexture _flagTexture;
9494
[[0,1],"STR_GNOTF_CaptureSuccess",true,[name player,(group player) getVariable "gang_name"]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
9595
_hideout setVariable ["inCapture",false,true];

Altis_Life.Altis/core/actions/fn_processAction.sqf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ if (_vendor in [mari_processor,coke_processor,heroin_processor]) then {
5454

5555
_cost = _cost * (count _oldItem);
5656

57-
_minimumConversions = _totalConversions call BIS_fnc_lowestNum;
57+
_minimumConversions = selectMin _totalConversions;
5858
_oldItemWeight = 0;
5959
{
6060
_weight = ([_x select 0] call life_fnc_itemWeight) * (_x select 1);
@@ -113,7 +113,7 @@ if (_hasLicense) then {
113113
} count _newItem;
114114

115115
"progressBar" cutText ["","PLAIN"];
116-
if (_minimumConversions isEqualTo (_totalConversions call BIS_fnc_lowestNum)) then {hint localize "STR_NOTF_ItemProcess";} else {hint localize "STR_Process_Partial";};
116+
if (_minimumConversions isEqualTo (selectMin _totalConversions)) then {hint localize "STR_NOTF_ItemProcess";} else {hint localize "STR_Process_Partial";};
117117
life_is_processing = false; life_action_inUse = false;
118118
} else {
119119
if (CASH < _cost) exitWith {hint format [localize "STR_Process_License",[_cost] call life_fnc_numberText]; "progressBar" cutText ["","PLAIN"]; life_is_processing = false; life_action_inUse = false;};
@@ -139,7 +139,7 @@ if (_hasLicense) then {
139139
} count _newItem;
140140

141141
"progressBar" cutText ["","PLAIN"];
142-
if (_minimumConversions isEqualTo (_totalConversions call BIS_fnc_lowestNum)) then {hint localize "STR_NOTF_ItemProcess";} else {hint localize "STR_Process_Partial";};
142+
if (_minimumConversions isEqualTo (selectMin _totalConversions)) then {hint localize "STR_NOTF_ItemProcess";} else {hint localize "STR_Process_Partial";};
143143
CASH = CASH - _cost;
144144
[0] call SOCK_fnc_updatePartial;
145145
life_is_processing = false;

Altis_Life.Altis/core/shops/fn_vehicleShopLBChange.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ _numberindexcolorarray = [];
9292
for "_i" from 0 to (count(_colorArray) - 1) do {
9393
_numberindexcolorarray pushBack _i;
9494
};
95-
_indexrandom = _numberindexcolorarray call BIS_fnc_selectRandom;
95+
_indexrandom = selectRandom _numberindexcolorarray;
9696
_ctrl lbSetCurSel _indexrandom;
9797

9898
if (_className in (LIFE_SETTINGS(getArray,"vehicleShop_rentalOnly"))) then {

Altis_Life.Altis/dialog/function/fn_spawnConfirm.sqf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if (life_spawn_point isEqualTo []) then {
1717
if (isNil {(call compile format ["%1",_sp select 0])}) then {
1818
player setPos (getMarkerPos (_sp select 0));
1919
} else {
20-
_spawnPos = (call compile format ["%1",_sp select 0]) call BIS_fnc_selectRandom;
20+
_spawnPos = selectRandom (call compile format ["%1",_sp select 0]);
2121
_spawnPos = _spawnPos buildingPos 0;
2222
player setPos _spawnPos;
2323
};
@@ -39,13 +39,13 @@ if (life_spawn_point isEqualTo []) then {
3939
};
4040

4141
{_bPos = _bPos - [(_house buildingPos _x)];} forEach (_house getVariable ["slots",[]]);
42-
_pos = _bPos call BIS_fnc_selectRandom;
42+
_pos = selectRandom _bPos;
4343
player setPosATL _pos;
4444
} else {
4545
player setPos (getMarkerPos (life_spawn_point select 0));
4646
};
4747
} else {
48-
_spawnPos = (call compile format ["%1", life_spawn_point select 0]) call BIS_fnc_selectRandom;
48+
_spawnPos = selectRandom (call compile format ["%1", life_spawn_point select 0]);
4949
_spawnPos = _spawnPos buildingPos 0;
5050
player setPos _spawnPos;
5151
};

0 commit comments

Comments
 (0)