From 89212fe690c28a0b21e17728fa2a676c53b41fb9 Mon Sep 17 00:00:00 2001 From: Steam Deck User Date: Thu, 16 Mar 2023 13:11:11 -0400 Subject: [PATCH] SERVER: Add MP5K and Springfield as .mbox entries --- source/server/defs/custom.qc | 2 +- source/server/entities/machines.qc | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/source/server/defs/custom.qc b/source/server/defs/custom.qc index 331a84b..321ad8a 100644 --- a/source/server/defs/custom.qc +++ b/source/server/defs/custom.qc @@ -395,7 +395,7 @@ float isPowerOn; .entity boxweapon; .float spins; .float papState; -float BoxWeapons[25]; +float BoxWeapons[27]; entity boxLocations[32]; float boxCount; vector boxOrigin; diff --git a/source/server/entities/machines.qc b/source/server/entities/machines.qc index edd7e8a..f3875b6 100644 --- a/source/server/entities/machines.qc +++ b/source/server/entities/machines.qc @@ -1175,6 +1175,12 @@ float(float r) Getweaponid = case 24: return W_TYPE; break; + case 25: + return W_MP5K; + break; + case 26: + return W_SPRING; + break; } return r; @@ -1186,8 +1192,8 @@ float(float r) Getweaponid = // float() randomweapon = { - local float r; - r = rint((random() * 24)); + float r; + r = rint((random() * 26)); // If this weapon is in our Box Array, we can return it. if (BoxWeapons[r] == 1) { @@ -1573,9 +1579,9 @@ void() mystery_touch = // void() Load_Mbox_Data = { - local float file; - local string h; - local int weapons_all_disabled = 1; + float file; + string h; + int weapons_all_disabled = 1; // Attempt to Open the File h = strcat(mapname, ".mbox"); @@ -1585,13 +1591,13 @@ void() Load_Mbox_Data = // There was no MBOX Data, enable all Weapons! // R.I.P. PSP Memory 90% of the time in this case.. if (file == -1) { - for (float i = 0; i < 25; i++) { + for (float i = 0; i < 27; i++) { BoxWeapons[i] = 1; } fclose(file); } else { // Parse each Line and write the Data into our Array. - for (float i = 0; i < 25; i++) { + for (float i = 0; i < 27; i++) { h = strtrim((fgets(file))); BoxWeapons[i] = stof(h); @@ -1601,12 +1607,12 @@ void() Load_Mbox_Data = } if (weapons_all_disabled) { - for (float i = 0; i < 25; i++) { + for (float i = 0; i < 27; i++) { BoxWeapons[i] = 1; } } - for(float i = 0; i < 25; i++) { + for(float i = 0; i < 27; i++) { // Precache Weapon Data if enabled if (BoxWeapons[i]) { precache_model(GetWeaponModel(Getweaponid(i), 0));