diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:54:45 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:54:45 +0300 |
| commit | 68d4c9bbd80ed2e6528244569c79676b87295bd1 (patch) | |
| tree | 6efd42fbf6f1281874ae0ff1f8816b01fe0c7153 /Server/AI/AI_Upgrade.sqf | |
| download | a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.tar.gz a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.tar.bz2 a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.zip | |
init
Diffstat (limited to 'Server/AI/AI_Upgrade.sqf')
| -rw-r--r-- | Server/AI/AI_Upgrade.sqf | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Server/AI/AI_Upgrade.sqf b/Server/AI/AI_Upgrade.sqf new file mode 100644 index 0000000..dabac71 --- /dev/null +++ b/Server/AI/AI_Upgrade.sqf @@ -0,0 +1,32 @@ +Private ["_index","_index2","_name","_side","_sideText","_time","_upgrades","_upgrades_old"];
+_time = _this select 0;
+_index = _this select 1;
+_index2 = _this select 2;
+_name = _this select 3;
+_side = _this select 4;
+_sideText = Str _side;
+
+Call Compile Format ["WFBE_%1_Upgrading = true; publicVariable 'WFBE_%1_Upgrading';",_sideText];
+
+_upgrades_old = (_sideText) Call GetSideUpgrades;
+
+sleep _time;
+
+_upgrades = (_sideText) Call GetSideUpgrades;
+
+//--- Failover due to faulty pv.
+for '_i' from 0 to count _upgrades_old do {
+ if ((_upgrades_old select _i) != (_upgrades select _i)) then {_upgrades set [_i, (_upgrades_old select _i)]};
+};
+
+_upgrades set [_index2,_index + 1];
+Call Compile Format ["%1Upgrades = _upgrades; publicVariable '%1Upgrades';",_sideText];
+
+WFBE_LocalizeMessage = [_side,'CLTFNCLOCALIZEMESSAGE',['UpgradeComplete',_index2,(_index + 1)]];
+publicVariable 'WFBE_LocalizeMessage';
+if (isHostedServer) then {[_side,'CLTFNCLOCALIZEMESSAGE',['UpgradeComplete',_index2,(_index + 1)]] Spawn HandlePVF};
+[Format["WFBE_%1_Upgrading",_sideText],false,true] Call SetNamespace;
+
+["NewIntelAvailable","",_side,""] Spawn SideMessage;
+
+Call Compile Format ["WFBE_%1_Upgrading = false; publicVariable 'WFBE_%1_Upgrading';",_sideText];
|
