SERVER: Convert some props and buy_weapon entities for NZ:P Beta

This commit is contained in:
cypress 2023-12-30 12:05:08 -05:00
parent 8c01945f1b
commit 21ce43b477
3 changed files with 131 additions and 2 deletions

View file

@ -316,7 +316,7 @@ void() misc_model =
// Make static (not animate) if not given a frame range, and not affected by gravity
// also remains active if it has a targetname (so it can be killtargeted/toggled)
if (!self.last_frame && !(self.spawnflags & 1) && !(self.spawnflags & MISC_MODEL_SOLID) && !self.targetname)
if (!self.last_frame && !(self.spawnflags & 1) && !(self.spawnflags & MISC_MODEL_SOLID) && !self.targetname && self.classname != "place_model")
makestatic(self);
// if it as a custom animation range
@ -335,7 +335,8 @@ void() misc_model =
else
self.state = STATE_INVISIBLE;
misc_model_use();
if (self.classname != "place_model")
misc_model_use();
};
//
@ -344,6 +345,8 @@ void() misc_model =
//
void() place_model =
{
self.classname = "place_model";
// Grab an updated model path.
self.model = convert_old_asset_path(self.model);

View file

@ -28,6 +28,7 @@
void() LS_Setup;
void() PU_Init;
void() Compat_Init;
void() SUB_Remove = {remove(self);}
//called when starting server/loading the map
@ -143,6 +144,7 @@ void() StartFrame =
updateDogRound();
InitRounds();
Compat_Init();
}
}
}

View file

@ -26,6 +26,113 @@
*/
//
// NZ:P Beta Props
//
//
// Compat_ConvertPropScale(model_path, scale_factor)
// Does the dirty work for Compat_ConvertPropScaling().
//
void(string model_path, float scale_factor) Compat_ConvertPropScale =
{
entity props = find(world, model, model_path);
while(props != world) {
props.scale = scale_factor;
props = props = find(props, model, model_path);
}
}
//
// Compat_ConvertPropScaling()
// A lot of props nowadays are larger than
// originally designed, so scale them back
// down.
//
void() Compat_ConvertPropScaling =
{
Compat_ConvertPropScale("models/props/sandbags.mdl", 0.88);
}
//
// NZ:P Beta Wall Weapons
//
//
// Compat_ConvertBetaWallWeapons()
// NZ:P Beta used different weapon IDs to refer
// to weapon indexes, this fixes that.
//
void() Compat_ConvertBetaWallWeapons =
{
entity weapons;
weapons = find(world, classname, "buy_weapon");
while(weapons != world) {
switch(weapons.weapon) {
case 1: weapons.weapon = W_COLT; break;
case 64: weapons.weapon = W_RAY; break;
case 129: weapons.weapon = W_KAR_SCOPE; break;
case 130: weapons.weapon = W_BAR; break;
case 131: weapons.weapon = W_M1A1; break;
case 132: weapons.weapon = W_M2; break;
case 133: weapons.weapon = W_TESLA; break;
case 134: weapons.weapon = W_THOMPSON; break;
case 135: weapons.weapon = W_SAWNOFF; break;
case 136: weapons.weapon = W_PPSH; break;
case 137: weapons.weapon = W_DB; break;
case 138: weapons.weapon = W_KAR; break;
case 139: weapons.weapon = W_FG; break;
case 140: weapons.weapon = W_TRENCH; break;
case 141: weapons.weapon = W_MG; break;
case 142: weapons.weapon = W_GEWEHR; break;
case 143: weapons.weapon = W_BROWNING; break;
case 144: weapons.weapon = W_MP5K; break;
case 145: weapons.weapon = W_357; break;
case 146: weapons.weapon = W_M1; break;
case 147: weapons.weapon = W_BIATCH; break;
case 148: weapons.weapon = W_MP40; break;
case 149: weapons.weapon = W_PANZER; break;
case 150: weapons.weapon = W_PTRS; break;
case 153: weapons.weapon = W_BK; break;
case 154: weapons.weapon = W_STG; break;
case 155: weapons.weapon = W_BETTY; break;
case 156: weapons.weapon = W_GRENADE; break;
case 182: weapons.weapon = W_TYPE; break;
case 157: weapons.weapon = W_PORTER; break;
case 158: weapons.weapon = W_HEADCRACKER; break;
case 159: weapons.weapon = W_WIDOW; break;
case 160: weapons.weapon = W_WIDDER; break;
case 161: weapons.weapon = W_FIW; break;
case 162: weapons.weapon = W_WUNDER; break;
case 163: weapons.weapon = W_GIBS; break;
case 164: weapons.weapon = W_SNUFF; break;
case 165: weapons.weapon = W_REAPER; break;
case 166: weapons.weapon = W_BORE; break;
case 167: weapons.weapon = W_ARMAGEDDON; break;
case 168: weapons.weapon = W_IMPELLER; break;
case 169: weapons.weapon = W_GUT; break;
case 170: weapons.weapon = W_BARRACUDA; break;
case 171: weapons.weapon = W_COMPRESSOR; break;
case 172: weapons.weapon = W_ACCELERATOR; break;
case 173: weapons.weapon = W_KILLU; break;
case 174: weapons.weapon = W_KOLLIDER; break;
case 175: weapons.weapon = W_M1000; break;
case 176: weapons.weapon = W_AFTERBURNER; break;
case 177: weapons.weapon = W_LONGINUS; break;
case 178: weapons.weapon = W_PENETRATOR; break;
case 179: weapons.weapon = W_KRAUS; break;
case 180: weapons.weapon = W_SPATZ; break;
case 181: weapons.weapon = W_BOWIE; break;
case 183: weapons.weapon = W_SAMURAI; break;
default: break;
}
weapons = find(weapons, classname, "buy_weapon");
}
}
//
// NZ:P Beta Barricades
//
@ -97,3 +204,20 @@ void() item_juggernog = {map_compatibility_mode = MAP_COMPAT_BETA; Compat_Reloca
void() item_douple = {map_compatibility_mode = MAP_COMPAT_BETA; Compat_RelocateBetaPerkMachine(COMPAT_RELOCAT_NORM); perk_double();};
void() item_staminup = {map_compatibility_mode = MAP_COMPAT_BETA; Compat_RelocateBetaPerkMachine(COMPAT_RELOCAT_NORM); perk_staminup();};
void() item_pap = {map_compatibility_mode = MAP_COMPAT_BETA; Compat_RelocateBetaPerkMachine(COMPAT_RELOCAT_PAP); perk_pap();};
//
// Compat_Init()
// Called as soon as the server spawns in
// a client, does more conversion for
// map compatibility that cannot just be
// done in QC logic or in spawn functions.
//
void() Compat_Init =
{
if (map_compatibility_mode != MAP_COMPAT_BETA)
return;
Compat_ConvertBetaWallWeapons();
Compat_ConvertPropScaling();
}