Skip to content

Commit 0263e08

Browse files
committed
Fixed infinite loop of FOB spawning
1 parent 973d672 commit 0263e08

File tree

3 files changed

+46
-46
lines changed

3 files changed

+46
-46
lines changed

source/functions/support/fn_fob.sqf

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ if (_amountOPFOR > 0) exitWith {
4242
_art = [player,"fob_support"] call BIS_fnc_addCommMenuItem;
4343
};
4444

45-
// Attempt to find a safe position
45+
// Attempt to find a safe position
4646
_foundPickupPos = [_position, 0,50,10,0,0.2,0,[],[[0,0],[0,0]]] call BIS_fnc_findSafePos; // find a valid pos
4747
if (0 == _foundPickupPos select 0 && 0 == _foundPickupPos select 1) exitWith {
4848
hint "No valid FOB pos nearby\nTry to go near a flat, object free zone.";
@@ -72,21 +72,7 @@ sleep 5;
7272

7373
_fob = "Land_Cargo_HQ_V1_F" createVehicle _foundPickupPos;
7474

75-
DUWS_fnc_fob = {
76-
_this addaction ["<t color='#ff00ff'>Player stats</t>",{_this spawn duws_fnc_info}, "", 0, true, true, "", "_this == player"];
77-
_this addaction ["<t color='#15ff00'>Request ammobox drop(2CP)</t>",{_this spawn duws_fnc_fob_ammobox}, "", 0, true, true, "", "_this == player"];
78-
_this addaction ["<t color='#ffb700'>Squad manager</t>",{_this spawn duws_fnc_squadmng}, "", 0, true, true, "", "_this == player"];
79-
_this addaction ["<t color='#ffb700'>FOB manager</t>",{_this spawn duws_fnc_fobmanageropen}, "", 0, true, true, "", "_this == player"];
80-
if (support_armory_available) then {
81-
_this addaction ["<t color='#ff0066'>Armory (VA)</t>","bisArsenal.sqf", "", 0, true, true, "", "_this == player"];
82-
};
83-
if (isServer) then {
84-
_this addaction ["<t color='#00b7ff'>Rest (wait/save)</t>",{[]spawn duws_fnc_savegame}, "", 0, true, true, "", "_this == player"];
85-
} else {
86-
_this addaction ["<t color='#00b7ff'>Rest</t>",{[] spawn duws_fnc_savegameClient}, "", 0, true, true, "", "_this == player"];
87-
};
88-
};
89-
[_fob,"DUWS_fnc_fob",true,true] spawn BIS_fnc_MP; // [_fob,"DUWS_fnc_fob",nil,true] spawn BIS_fnc_MP;
75+
_fob remoteExecCall ["DUWS_fnc_fob_addAction", 0, true];
9076

9177
// For fortifying
9278
_fob addaction ["<t color='#ff0000'>Fortify FOB(4CP)</t>","_this spawn duws_fnc_fortifyFOB", [(getpos _fob), _fob], 0, true, true, "", "_this == player"];
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
_this addaction ["<t color='#ff00ff'>Player stats</t>",{_this spawn duws_fnc_info}, "", 0, true, true, "", "_this == player"];
2+
_this addaction ["<t color='#15ff00'>Request ammobox drop(2CP)</t>",{_this spawn duws_fnc_fob_ammobox}, "", 0, true, true, "", "_this == player"];
3+
_this addaction ["<t color='#ffb700'>Squad manager</t>",{_this spawn duws_fnc_squadmng}, "", 0, true, true, "", "_this == player"];
4+
_this addaction ["<t color='#ffb700'>FOB manager</t>",{_this spawn duws_fnc_fobmanageropen}, "", 0, true, true, "", "_this == player"];
5+
if (support_armory_available) then {
6+
_this addaction ["<t color='#ff0066'>Armory (VA)</t>","bisArsenal.sqf", "", 0, true, true, "", "_this == player"];
7+
};
8+
if (isServer) then {
9+
_this addaction ["<t color='#00b7ff'>Rest (wait/save)</t>",{[]spawn duws_fnc_savegame}, "", 0, true, true, "", "_this == player"];
10+
} else {
11+
_this addaction ["<t color='#00b7ff'>Rest</t>",{[] spawn duws_fnc_savegameClient}, "", 0, true, true, "", "_this == player"];
12+
};

source/includes/CfgFunctions.hpp

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class CfgFunctions
1111
//postInit = 1;
1212
};
1313
//duws_fnc_serverInit
14-
class serverInit
14+
class serverInit
1515
{
1616
//preInit = 1;
1717
};
@@ -24,7 +24,7 @@ class CfgFunctions
2424
class processVehicleConfig {};
2525
class processGroupConfig {};
2626
};
27-
27+
2828
class generic
2929
{
3030
class bisArsenal {};
@@ -45,7 +45,7 @@ class CfgFunctions
4545
// [] call duws_fnc_convertCPtoAP
4646
class dynamic_menu {};
4747
// [???] spawn duws_fnc_dynamic_menu
48-
class dyn_music_init
48+
class dyn_music_init
4949
{
5050
postInit = 1;
5151
};
@@ -85,7 +85,7 @@ class CfgFunctions
8585
class hc_init {};
8686
// [] call duws_fnc_hc_init
8787
};
88-
88+
8989
class fob
9090
{
9191
class fast_travel {};
@@ -97,21 +97,21 @@ class CfgFunctions
9797
class reinforce {};
9898
// [] spawn duws_fnc_reinforce
9999
};
100-
100+
101101
class utilities
102102
{
103103
class autoSave {};
104104
// [] spawn duws_fnc_autoSave
105105
class groupReset {};
106106
// [] call duws_fnc_groupReset
107107
};
108-
108+
109109
class WARCOM
110110
{
111111
class random_veh_blu_patrol {};
112-
// [faction, vehclass, position, radius] spawn duws_fnc_random_veh_blu_patrol
112+
// [faction, vehclass, position, radius] spawn duws_fnc_random_veh_blu_patrol
113113
class random_veh_opf_patrol {};
114-
// [faction, vehclass, position, radius] spawn duws_fnc_random_veh_opf_patrol
114+
// [faction, vehclass, position, radius] spawn duws_fnc_random_veh_opf_patrol
115115
class WARCOM_blu_assault {};
116116
// [] call duws_fnc_WARCOM_blu_assault
117117
class WARCOM_blu_patrol {};
@@ -137,7 +137,7 @@ class CfgFunctions
137137
class WARCOM_wp_opf_qrf {};
138138
// [group, unitpos] call duws_fnc_WARCOM_wp_opf_qrf
139139
};
140-
140+
141141
class initHQ
142142
{
143143
class BluHQinit {};
@@ -181,7 +181,7 @@ class CfgFunctions
181181
class commanderAnim {};
182182
// [unit] call duws_fnc_commanderAnim
183183
};
184-
184+
185185
class startup
186186
{
187187
class manual {};
@@ -209,7 +209,7 @@ class CfgFunctions
209209
class weather_client {};
210210
// [] spawn duws_fnc_weather_client
211211
};
212-
212+
213213
class initZones
214214
{
215215
class createzone {};
@@ -223,15 +223,15 @@ class CfgFunctions
223223
class locatorzonesV2 {};
224224
// [radius, diff] spawn duws_fnc_locatorzonesV2
225225
};
226-
226+
227227
class zonescap
228228
{
229229
class blufor_cap {}
230230
// [place, points, markername, markername2, triggerPos] call duws_fnc_blufor_cap
231231
class opfor_cap {};
232232
// [place, points, markername, markername2, triggerPos] call duws_fnc_opfor_cap
233233
};
234-
234+
235235
class prefabs
236236
{
237237
class site_Barracks {};
@@ -246,7 +246,7 @@ class CfgFunctions
246246
class site_researchStation {};
247247
class site_vehfittingstation {};
248248
};
249-
249+
250250
class persistent
251251
{
252252
class persistent_stats_init {};
@@ -259,7 +259,7 @@ class CfgFunctions
259259
// [] call duws_fnc_persistent_stats_win;
260260
class persistent_stats_zones_add {};
261261
// [] call duws_fnc_persistent_stats_zones_add;
262-
262+
263263
class experience_init {};
264264
// [] call duws_fnc_experience_init;
265265
class experience_ability_check {};
@@ -281,7 +281,7 @@ class CfgFunctions
281281
class experience_ability_warrior {};
282282
// [player] spawn duws_fnc_experience_ability_warruir
283283
};
284-
284+
285285
class operative
286286
{
287287
class operator_add_aim {};
@@ -305,7 +305,7 @@ class CfgFunctions
305305
class operator_recruit {};
306306
// [] spawn duws_fnc_operator_recruit
307307
};
308-
308+
309309
class missions
310310
{
311311
class destroy_mission {};
@@ -328,13 +328,13 @@ class CfgFunctions
328328
// [location] spawn duws_fnc_underwater_mission
329329
class underwater_success {};
330330
// (in addaction) {_this call duws_fnc_underwater_success;}
331-
331+
332332
class missionTimer {};
333333
// [] spawn duws_fnc_missionTimer
334334
class stratmap {};
335335
// [] spawn duws_fnc_stratmap
336336
};
337-
337+
338338
class squad
339339
{
340340
class copyloadout {};
@@ -348,7 +348,7 @@ class CfgFunctions
348348
class squadmng {};
349349
// [] spawn duws_fnc_squadmng
350350
};
351-
351+
352352
class support
353353
{
354354
class ammobox {};
@@ -357,6 +357,8 @@ class CfgFunctions
357357
// [position, salvos, radius, interval, rps, supporttype, cost, ammotype] spawn duws_fnc_arty
358358
class fob {};
359359
// [position, size] spawn duws_fnc_fob
360+
class fob_addAction {};
361+
// object remoteExecCall ["DUWS_fnc_fob_addAction", ]
360362
class fob_ammobox {};
361363
// [target, location] spawn duws_fnc_fob_ammobox
362364
class FOBactions {};
@@ -375,7 +377,7 @@ class CfgFunctions
375377
// [centerPos, checkedRadius] spawn duws_fnc_uav_map
376378
class veh_refit {};
377379
// [] call duws_fnc_veh_refit
378-
380+
379381
// Taxi
380382
class boatTaxi
381383
{
@@ -402,7 +404,7 @@ class CfgFunctions
402404
file = "functions\support\taxi\fn_random_music.sqf";
403405
};
404406
// [] call duws_fnc_random_music
405-
407+
406408
// Cluster
407409
class cluster
408410
{
@@ -415,30 +417,30 @@ class CfgFunctions
415417
};
416418
// [salvos, radius, interval, rps, supporttype, cost, ammotype] spawn duws_fnc_mapclickcluster
417419
};
418-
420+
419421
class misc
420422
{
421423
class bottom_right_message {};
422424
// [position, date] call duws_fnc_bottom_right_message
423425
class gps_marker {};
424426
// [] spawn duws_fnc_gps_marker
425427
};
426-
428+
427429
class info
428430
{
429431
class info {};
430432
// [] spawn duws_fnc_info
431433
};
432-
434+
433435
class pFLIR
434436
{
435437
class livefeed {};
436438
class livefeed1 {};
437439
class livefeedexit {};
438440
};
439-
441+
440442
};
441-
class TAW_VD
443+
class TAW_VD
442444
{
443445
tag = "TAWVD";
444446

@@ -449,7 +451,7 @@ class CfgFunctions
449451
postInit = 1;
450452
headerType = -1;
451453
};
452-
454+
453455
class onSliderChanged {};
454456
class onTerrainChanged {};
455457
class updateViewDistance {};
@@ -460,6 +462,6 @@ class CfgFunctions
460462
class onSaveSelectionChanged {};
461463
};
462464
};
463-
465+
464466
#include "..\AIS\cfgFunctions.hpp"
465-
};
467+
};

0 commit comments

Comments
 (0)