Added integer and description fields to cvar_t struct in game DLLs.

Fixed trailing ' in precache entry for weapon_chaingun.
Added sk_plasma_rifle_life_bounce and sk_plasma_rifle_life_spread cvars to
  missionpack DLL to control time-to-remove of plasma rifle projectiles.
Added SAVEGAME_DLLNAME specific to Citadel builds of missionpack DLL.
Added support for building a version of missionpack DLL specific to Quake2Evolved v0.40b.
This commit is contained in:
Knightmare66 2020-08-23 18:04:50 -04:00
parent 87e25e6e21
commit 90274a87dd
14 changed files with 59 additions and 38 deletions

View file

@ -2237,7 +2237,7 @@ always owned, never in the world
// WEAP_CHAINGUN,
NULL,
0,
/* precache */ "weapons/chngnu1a.wav weapons/chngnl1a.wav weapons/machgf3b.wav` weapons/chngnd1a.wav"
/* precache */ "weapons/chngnu1a.wav weapons/chngnl1a.wav weapons/machgf3b.wav weapons/chngnd1a.wav"
},
/*QUAKED ammo_trap (.3 .3 1) (-16 -16 -16) (16 16 16)

View file

@ -353,6 +353,8 @@ typedef struct cvar_s
// Knightmare- added cvar defaults
#ifdef KMQUAKE2_ENGINE_MOD
char *default_string;
int integer;
char *description;
#endif
} cvar_t;

View file

@ -484,8 +484,6 @@ void CL_ParseConfigString (void)
Com_Error (ERR_DROP, "configstring > MAX_CONFIGSTRINGS");
s = MSG_ReadString(&net_message);
// strncpy (olds, cl.configstrings[i], sizeof(olds));
// olds[sizeof(olds) - 1] = 0;
Q_strncpyz (olds, cl.configstrings[i], sizeof(olds));
// check length
@ -493,23 +491,10 @@ void CL_ParseConfigString (void)
if ( length >= (sizeof(cl.configstrings[0]) * (MAX_CONFIGSTRINGS - i)) - 1 )
Com_Error (ERR_DROP, "CL_ParseConfigString: string %d exceeds available buffer space!", i);
// Don't use a null-terminated strncpy here!!
// strcpy (cl.configstrings[i], s);
if (i >= CS_STATUSBAR && i < CS_AIRACCEL) { // allow writes to statusbar strings to overflow
strncpy (cl.configstrings[i], s, (sizeof(cl.configstrings[i]) * (CS_AIRACCEL - i))-1 );
cl.configstrings[CS_AIRACCEL-1][MAX_QPATH-1] = 0; // null terminate end of section
}
// Removed these because strncpy() overwrites destination with trailing zeroes until count is reached
/* else if ( LegacyProtocol() && (i >= OLD_CS_GENERAL && i < OLD_MAX_CONFIGSTRINGS) ) { // allow writes to general strings to overflow
strncpy (cl.configstrings[i], s, (sizeof(cl.configstrings[i]) * (OLD_MAX_CONFIGSTRINGS - i))-1 );
cl.configstrings[OLD_MAX_CONFIGSTRINGS-1][MAX_QPATH-1] = 0; // null terminate end of section
// Com_Printf("CL_ParseConfigString: CS_GENERAL %i: '%s', maxlen=%i\n", i, s, (sizeof(cl.configstrings[i]) * (OLD_MAX_CONFIGSTRINGS - i))-1);
}
else if ( !LegacyProtocol() && (i >= CS_GENERAL && i < CS_PAKFILE) ) { // allow writes to general strings to overflow
strncpy (cl.configstrings[i], s, (sizeof(cl.configstrings[i]) * (CS_PAKFILE - i))-1 );
cl.configstrings[CS_PAKFILE-1][MAX_QPATH-1] = 0; // null terminate end of section
// Com_Printf("CL_ParseConfigString: CS_GENERAL %i: '%s', maxlen=%i\n", i, s, (sizeof(cl.configstrings[i]) * (CS_PAKFILE - i))-1);
}*/
else {
if (length >= MAX_QPATH)
Com_Printf(S_COLOR_YELLOW"CL_ParseConfigString: string %d of length %d exceeds MAX_QPATH.\n", i, (int)length);

View file

@ -1950,7 +1950,7 @@ always owned, never in the world
WEAP_CHAINGUN,
NULL,
0,
/* precache */ "weapons/chngnu1a.wav weapons/chngnl1a.wav weapons/machgf3b.wav` weapons/chngnd1a.wav"
/* precache */ "weapons/chngnu1a.wav weapons/chngnl1a.wav weapons/machgf3b.wav weapons/chngnd1a.wav"
},
/*QUAKED ammo_grenades (.3 .3 1) (-16 -16 -16) (16 16 16)

View file

@ -90,6 +90,8 @@ Changes as of v0.20 update 8:
- Fixed missing menu text when joining a Rocket Arena 2 server.
- Fixed missing HUD text when joining an OSP Tourney server.
- Fixed fog disappearing after a vid_restart.
- Shadow volumes will now be drawn even if the model isn't in view.

View file

@ -2647,7 +2647,7 @@ gitem_t itemlist[] =
WEAP_CHAINGUN,
NULL,
0,
"weapons/chngnu1a.wav weapons/chngnl1a.wav weapons/machgf3b.wav` weapons/chngnd1a.wav" // precache
"weapons/chngnu1a.wav weapons/chngnl1a.wav weapons/machgf3b.wav weapons/chngnd1a.wav" // precache
},
// 14

View file

@ -2146,6 +2146,7 @@ void SP_worldspawn (edict_t *ent)
gi.modelindex ("#w_railgun.md2");
gi.modelindex ("#w_bfg.md2");
#ifdef KMQUAKE2_ENGINE_MOD // only allow missionpack vweps for KMQ2 builds
gi.modelindex ("#w_disrupt.md2"); // PGM
gi.modelindex ("#w_etfrifle.md2"); // PGM
gi.modelindex ("#w_plasma.md2"); // PGM
@ -2155,9 +2156,11 @@ void SP_worldspawn (edict_t *ent)
gi.modelindex ("#w_ripper.md2"); // Knightmare added
gi.modelindex ("#w_shockwave.md2"); // Knightmare added
gi.modelindex ("#w_plasmarifle.md2"); // SKWiD MOD
// gi.modelindex ("#a_trap.md2"); // Knightmare added
// gi.modelindex ("#a_tesla.md2"); // Knightmare added
// gi.modelindex ("#w_grapple.md2");
#endif // KMQUAKE2_ENGINE_MOD
}
//-------------------

View file

@ -335,12 +335,14 @@ void blaster_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *
if (self->style == BLASTER_GREEN) //green
tempevent = TE_BLASTER2;
else if (self->style == BLASTER_BLUE) //blue
#ifdef KMQUAKE2_ENGINE_MOD // Knightmare- looks better than flechette
tempevent = TE_BLUEHYPERBLASTER;
// #ifdef KMQUAKE2_ENGINE_MOD
#if defined (KMQUAKE2_ENGINE_MOD) || defined (Q2E_ENGINE_MOD)
tempevent = TE_BLUEHYPERBLASTER; // Knightmare- looks better than flechette
#else
tempevent = TE_FLECHETTE;
#endif
#ifdef KMQUAKE2_ENGINE_MOD
// #ifdef KMQUAKE2_ENGINE_MOD
#if defined (KMQUAKE2_ENGINE_MOD) || defined (Q2E_ENGINE_MOD)
else if (self->style == BLASTER_RED) //red
tempevent = TE_REDBLASTER;
#endif
@ -1603,7 +1605,8 @@ void fire_rail (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick
qboolean water;
// Knightmare- changeable trail color
#ifdef KMQUAKE2_ENGINE_MOD
//#ifdef KMQUAKE2_ENGINE_MOD
#if defined (KMQUAKE2_ENGINE_MOD) || defined (Q2E_ENGINE_MOD)
if (self->client && sk_rail_color->value == 2)
tempevent = TE_RAILTRAIL2;
else
@ -3343,7 +3346,8 @@ void fire_plasma_rifle_bounce (edict_t *ent, vec3_t start, vec3_t dir, int damag
goop->think = G_FreeEdict; // change this to handle
// goop->nextthink = level.time + 3.0; // sprite animation?
goop->nextthink = level.time + 1.5;
// goop->nextthink = level.time + 1.5;
goop->nextthink = level.time + sk_plasma_rifle_life_bounce->value;
gi.linkentity (goop);
@ -3417,9 +3421,12 @@ void fire_plasma_rifle_spread (edict_t *ent, vec3_t start, vec3_t dir, int damag
goop_l->think = G_FreeEdict;
goop_c->think = G_FreeEdict;
goop_r->think = G_FreeEdict;
goop_l->nextthink = level.time + 3.0;
goop_c->nextthink = level.time + 3.0;
goop_r->nextthink = level.time + 3.0;
// goop_l->nextthink = level.time + 3.0;
// goop_c->nextthink = level.time + 3.0;
// goop_r->nextthink = level.time + 3.0;
goop_l->nextthink = level.time + sk_plasma_rifle_life_spread->value;
goop_c->nextthink = level.time + sk_plasma_rifle_life_spread->value;
goop_r->nextthink = level.time + sk_plasma_rifle_life_spread->value;
gi.linkentity (goop_l);
gi.linkentity (goop_c);

View file

@ -149,6 +149,8 @@ cvar_t *sk_plasma_rifle_damage_spread_dm;
cvar_t *sk_plasma_rifle_speed_bounce;
cvar_t *sk_plasma_rifle_speed_spread;
cvar_t *sk_plasma_rifle_radius;
cvar_t *sk_plasma_rifle_life_bounce;
cvar_t *sk_plasma_rifle_life_spread;
cvar_t *sk_flaregun_damage;
cvar_t *sk_flaregun_rdamage;
@ -484,6 +486,8 @@ void InitLithiumVars (void)
sk_plasma_rifle_speed_bounce = gi.cvar("sk_plasma_rifle_speed_bounce", "1200", 0);
sk_plasma_rifle_speed_spread = gi.cvar("sk_plasma_rifle_speed_spread", "1200", 0);
sk_plasma_rifle_radius = gi.cvar("sk_plasma_rifle_radius", "70", 0);
sk_plasma_rifle_life_bounce = gi.cvar("sk_plasma_rifle_life_bounce", "3", 0);
sk_plasma_rifle_life_spread = gi.cvar("sk_plasma_rifle_life_spread", "3", 0);
sk_flaregun_damage = gi.cvar("sk_flaregun_damage", "1", 0);
sk_flaregun_rdamage = gi.cvar("sk_flaregun_rdamage", "1", 0);

View file

@ -145,6 +145,8 @@ extern cvar_t *sk_plasma_rifle_damage_spread_dm;
extern cvar_t *sk_plasma_rifle_speed_bounce;
extern cvar_t *sk_plasma_rifle_speed_spread;
extern cvar_t *sk_plasma_rifle_radius;
extern cvar_t *sk_plasma_rifle_life_bounce;
extern cvar_t *sk_plasma_rifle_life_spread;
extern cvar_t *sk_flaregun_damage;
extern cvar_t *sk_flaregun_rdamage;

View file

@ -1625,14 +1625,16 @@ int Blaster_Fire (edict_t *ent, vec3_t g_offset, int damage, qboolean hyper, int
if (hyper)
{
if (color == BLASTER_GREEN)
#ifdef KMQUAKE2_ENGINE_MOD
// #ifdef KMQUAKE2_ENGINE_MOD
#if defined (KMQUAKE2_ENGINE_MOD) || defined (Q2E_ENGINE_MOD)
muzzleflash = MZ_GREENHYPERBLASTER;
#else
muzzleflash = MZ_HYPERBLASTER;
#endif
else if (color == BLASTER_BLUE)
muzzleflash = MZ_BLUEHYPERBLASTER;
#ifdef KMQUAKE2_ENGINE_MOD
// #ifdef KMQUAKE2_ENGINE_MOD
#if defined (KMQUAKE2_ENGINE_MOD) || defined (Q2E_ENGINE_MOD)
else if (color == BLASTER_RED)
muzzleflash = MZ_REDHYPERBLASTER;
#endif
@ -1644,12 +1646,14 @@ int Blaster_Fire (edict_t *ent, vec3_t g_offset, int damage, qboolean hyper, int
if (color == BLASTER_GREEN)
muzzleflash = MZ_BLASTER2;
else if (color == BLASTER_BLUE)
#ifdef KMQUAKE2_ENGINE_MOD
// #ifdef KMQUAKE2_ENGINE_MOD
#if defined (KMQUAKE2_ENGINE_MOD) || defined (Q2E_ENGINE_MOD)
muzzleflash = MZ_BLUEBLASTER;
#else
muzzleflash = MZ_BLASTER;
#endif
#ifdef KMQUAKE2_ENGINE_MOD
// #ifdef KMQUAKE2_ENGINE_MOD
#if defined (KMQUAKE2_ENGINE_MOD) || defined (Q2E_ENGINE_MOD)
else if (color == BLASTER_RED)
muzzleflash = MZ_REDBLASTER;
#endif
@ -1692,16 +1696,18 @@ void Weapon_Blaster_Fire (edict_t *ent, qboolean altfire)
// Knightmare- select color
color = sk_blaster_color->value;
// blaster_color could be any other value, so clamp it
if (sk_blaster_color->value < 2 || sk_blaster_color->value >4)
if (sk_blaster_color->value < 2 || sk_blaster_color->value > 4)
color = BLASTER_ORANGE;
#ifndef KMQUAKE2_ENGINE_MOD
//#ifndef KMQUAKE2_ENGINE_MOD
#if !defined (KMQUAKE2_ENGINE_MOD) && !defined (Q2E_ENGINE_MOD)
if (color == BLASTER_RED) color = BLASTER_ORANGE;
#endif
if (color == BLASTER_GREEN)
effect = EF_BLASTER|EF_TRACKER;
else if (color == BLASTER_BLUE)
#ifdef KMQUAKE2_ENGINE_MOD
//#ifdef KMQUAKE2_ENGINE_MOD
#if defined (KMQUAKE2_ENGINE_MOD) || defined (Q2E_ENGINE_MOD)
effect = EF_BLASTER|EF_BLUEHYPERBLASTER;
#else
effect = EF_BLUEHYPERBLASTER;
@ -1761,7 +1767,8 @@ void Weapon_HyperBlaster_Fire (edict_t *ent, qboolean altfire)
color = sk_hyperblaster_color->value;
if (sk_hyperblaster_color->value < 2 || sk_hyperblaster_color->value > 4)
color = BLASTER_ORANGE;
#ifndef KMQUAKE2_ENGINE_MOD
// #ifndef KMQUAKE2_ENGINE_MOD
#if !defined (KMQUAKE2_ENGINE_MOD) && !defined (Q2E_ENGINE_MOD)
if (color == BLASTER_RED) color = BLASTER_ORANGE;
#endif

View file

@ -77,6 +77,9 @@ __inline int Q_vsnprintf (char *Dest, size_t Count, const char *Format, va_list
#define Q_vsnprintf vsnprintf
#endif
// Knightmare- whether to include enhancements supported by Q2E 0.40b
//#define Q2E_ENGINE_MOD
// Knightmare- whether to include new engine enhancements
#define KMQUAKE2_ENGINE_MOD
@ -100,7 +103,11 @@ __inline int Q_vsnprintf (char *Dest, size_t Count, const char *Format, va_list
//#define CITADELMOD_FEATURES
#define SAVEGAME_USE_FUNCTION_TABLE
#ifdef CITADELMOD_FEATURES
#define SAVEGAME_DLLNAME "Citadel Quake II mod"
#else
#define SAVEGAME_DLLNAME "Rogue + Xatrix + Lazarus integrated mod"
#endif // CITADELMOD_FEATURES
#define SAVEGAME_VERSION 4
// angle indexes
@ -405,6 +412,7 @@ typedef struct cvar_s
#ifdef KMQUAKE2_ENGINE_MOD
char *default_string;
int integer;
char *description;
#endif
} cvar_t;
@ -791,12 +799,12 @@ typedef struct
#define MZ_NUKE2 37
#define MZ_NUKE4 38
#define MZ_NUKE8 39
//Knightmare 1/3/2002- blue blaster and green hyperblaster
// Knightmare 1/3/2002- blue blaster and green hyperblaster
#define MZ_BLUEBLASTER 40
#define MZ_GREENHYPERBLASTER 41
#define MZ_REDBLASTER 42
#define MZ_REDHYPERBLASTER 43
//end Knightmare
// end Knightmare
//ROGUE
//

View file

@ -1787,7 +1787,7 @@ always owned, never in the world
WEAP_CHAINGUN,
NULL,
0,
/* precache */ "weapons/chngnu1a.wav weapons/chngnl1a.wav weapons/machgf3b.wav` weapons/chngnd1a.wav"
/* precache */ "weapons/chngnu1a.wav weapons/chngnl1a.wav weapons/machgf3b.wav weapons/chngnd1a.wav"
},
/*QUAKED ammo_grenades (.3 .3 1) (-16 -16 -16) (16 16 16)

View file

@ -366,10 +366,11 @@ typedef struct cvar_s
qboolean modified; // set each time the cvar is changed
float value;
struct cvar_s *next;
// Knightmare- added cvar defaults
// Knightmare- added cvar defaults
#ifdef KMQUAKE2_ENGINE_MOD
char *default_string;
int integer;
char *description;
#endif
} cvar_t;