mirror of
https://github.com/nzp-team/quakec.git
synced 2025-02-18 09:51:41 +00:00
SERVER: Add MP5K and Springfield as .mbox entries
This commit is contained in:
parent
4098fbb8cc
commit
89212fe690
2 changed files with 16 additions and 10 deletions
|
@ -395,7 +395,7 @@ float isPowerOn;
|
||||||
.entity boxweapon;
|
.entity boxweapon;
|
||||||
.float spins;
|
.float spins;
|
||||||
.float papState;
|
.float papState;
|
||||||
float BoxWeapons[25];
|
float BoxWeapons[27];
|
||||||
entity boxLocations[32];
|
entity boxLocations[32];
|
||||||
float boxCount;
|
float boxCount;
|
||||||
vector boxOrigin;
|
vector boxOrigin;
|
||||||
|
|
|
@ -1175,6 +1175,12 @@ float(float r) Getweaponid =
|
||||||
case 24:
|
case 24:
|
||||||
return W_TYPE;
|
return W_TYPE;
|
||||||
break;
|
break;
|
||||||
|
case 25:
|
||||||
|
return W_MP5K;
|
||||||
|
break;
|
||||||
|
case 26:
|
||||||
|
return W_SPRING;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
|
@ -1186,8 +1192,8 @@ float(float r) Getweaponid =
|
||||||
//
|
//
|
||||||
float() randomweapon =
|
float() randomweapon =
|
||||||
{
|
{
|
||||||
local float r;
|
float r;
|
||||||
r = rint((random() * 24));
|
r = rint((random() * 26));
|
||||||
|
|
||||||
// If this weapon is in our Box Array, we can return it.
|
// If this weapon is in our Box Array, we can return it.
|
||||||
if (BoxWeapons[r] == 1) {
|
if (BoxWeapons[r] == 1) {
|
||||||
|
@ -1573,9 +1579,9 @@ void() mystery_touch =
|
||||||
//
|
//
|
||||||
void() Load_Mbox_Data =
|
void() Load_Mbox_Data =
|
||||||
{
|
{
|
||||||
local float file;
|
float file;
|
||||||
local string h;
|
string h;
|
||||||
local int weapons_all_disabled = 1;
|
int weapons_all_disabled = 1;
|
||||||
|
|
||||||
// Attempt to Open the File
|
// Attempt to Open the File
|
||||||
h = strcat(mapname, ".mbox");
|
h = strcat(mapname, ".mbox");
|
||||||
|
@ -1585,13 +1591,13 @@ void() Load_Mbox_Data =
|
||||||
// There was no MBOX Data, enable all Weapons!
|
// There was no MBOX Data, enable all Weapons!
|
||||||
// R.I.P. PSP Memory 90% of the time in this case..
|
// R.I.P. PSP Memory 90% of the time in this case..
|
||||||
if (file == -1) {
|
if (file == -1) {
|
||||||
for (float i = 0; i < 25; i++) {
|
for (float i = 0; i < 27; i++) {
|
||||||
BoxWeapons[i] = 1;
|
BoxWeapons[i] = 1;
|
||||||
}
|
}
|
||||||
fclose(file);
|
fclose(file);
|
||||||
} else {
|
} else {
|
||||||
// Parse each Line and write the Data into our Array.
|
// 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)));
|
h = strtrim((fgets(file)));
|
||||||
BoxWeapons[i] = stof(h);
|
BoxWeapons[i] = stof(h);
|
||||||
|
|
||||||
|
@ -1601,12 +1607,12 @@ void() Load_Mbox_Data =
|
||||||
}
|
}
|
||||||
|
|
||||||
if (weapons_all_disabled) {
|
if (weapons_all_disabled) {
|
||||||
for (float i = 0; i < 25; i++) {
|
for (float i = 0; i < 27; i++) {
|
||||||
BoxWeapons[i] = 1;
|
BoxWeapons[i] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(float i = 0; i < 25; i++) {
|
for(float i = 0; i < 27; i++) {
|
||||||
// Precache Weapon Data if enabled
|
// Precache Weapon Data if enabled
|
||||||
if (BoxWeapons[i]) {
|
if (BoxWeapons[i]) {
|
||||||
precache_model(GetWeaponModel(Getweaponid(i), 0));
|
precache_model(GetWeaponModel(Getweaponid(i), 0));
|
||||||
|
|
Loading…
Reference in a new issue