Added V_Shutdown() function.

Added better error message for clientnum underflow in HUD layout string.
Changed cvar ion_ripper_extra_sounds to default to 0 in missionpack DLL.
This commit is contained in:
Knightmare66 2021-03-01 21:49:38 -05:00
parent 180292a66b
commit 8083f057cf
11 changed files with 134 additions and 88 deletions

View file

@ -387,8 +387,10 @@ void CL_ExecuteLayoutString (char *s, qboolean isStatusBar)
token = COM_Parse (&s);
value = atoi(token);
if (value >= MAX_CLIENTS || value < 0)
Com_Error (ERR_DROP, "client >= MAX_CLIENTS");
if (value >= MAX_CLIENTS)
Com_Error (ERR_DROP, "client (%d) >= MAX_CLIENTS", value);
else if (value < 0)
Com_Error (ERR_DROP, "client (%d) < 0", value);
ci = &cl.clientinfo[value];
token = COM_Parse (&s);
@ -424,8 +426,10 @@ void CL_ExecuteLayoutString (char *s, qboolean isStatusBar)
token = COM_Parse (&s);
value = atoi(token);
if (value >= MAX_CLIENTS || value < 0)
Com_Error (ERR_DROP, "client >= MAX_CLIENTS");
if (value >= MAX_CLIENTS)
Com_Error (ERR_DROP, "client (%d) >= MAX_CLIENTS", value);
else if (value < 0)
Com_Error (ERR_DROP, "client (%d) < 0", value);
ci = &cl.clientinfo[value];
token = COM_Parse (&s);
@ -457,8 +461,10 @@ void CL_ExecuteLayoutString (char *s, qboolean isStatusBar)
token = COM_Parse (&s);
value = atoi(token);
if (value >= MAX_CLIENTS || value < 0)
Com_Error (ERR_DROP, "client >= MAX_CLIENTS");
if (value >= MAX_CLIENTS)
Com_Error (ERR_DROP, "client (%d) >= MAX_CLIENTS", value);
else if (value < 0)
Com_Error (ERR_DROP, "client (%d) < 0", value);
ci = &cl.clientinfo[value];
token = COM_Parse (&s);

View file

@ -2972,7 +2972,7 @@ void CL_Shutdown (void)
sec = Sys_Milliseconds();
// end delay
S_Shutdown();
S_Shutdown ();
// added delay
sec = base = Sys_Milliseconds();
@ -2980,6 +2980,8 @@ void CL_Shutdown (void)
sec = Sys_Milliseconds();
// end delay
V_Shutdown ();
CL_ShutdownLocal (); // added Local shutdown
IN_Shutdown ();
VID_Shutdown();

View file

@ -44,7 +44,7 @@ float scr_letterbox_lines; // 0.0 to 1.0 lines of letterbox to display
qboolean scr_letterbox_active;
qboolean scr_hidehud;
qboolean scr_initialized; // ready to draw
qboolean scr_initialized = false; // ready to draw
int scr_draw_loading;

View file

@ -62,6 +62,8 @@ foginfo_t r_foginfo; // Knightmare added
char cl_weaponmodels[MAX_CLIENTWEAPONMODELS][MAX_QPATH];
int num_cl_weaponmodels;
qboolean v_initialized = false; // ready to draw
/*
====================
V_ClearScene
@ -973,4 +975,33 @@ void V_Init (void)
// Knightmare- init fog info
V_ClearFogInfo ();
v_initialized = true;
}
/*
=============
V_Shutdown
=============
*/
void V_Shutdown (void)
{
if (!v_initialized)
return;
Cmd_RemoveCommand ("gun_next");
Cmd_RemoveCommand ("gun_prev");
Cmd_RemoveCommand ("gun_model");
Cmd_RemoveCommand ("viewpos");
// Knightmare- diagnostic commands from Lazarus
Cmd_RemoveCommand ("texture");
Cmd_RemoveCommand ("surf");
// Cmd_RemoveCommand ("bbox");
V_ClearFogInfo ();
v_initialized = false;
}

View file

@ -910,6 +910,7 @@ void V_ClipCam (vec3_t start, vec3_t end, vec3_t newpos);
void V_CalcViewerCamTrans (float dist);
void V_AddEntity (entity_t *ent);
void V_Init (void);
void V_Shutdown (void);
// Psychospaz's enhanced particle code
void V_AddParticle (vec3_t org, vec3_t angle, vec3_t color, float alpha,

View file

@ -3784,7 +3784,7 @@ void train_remove_children (edict_t *self)
}
}
//Knightmare- these functions fade away the movewith children of func_breakaway
// Knightmare- these functions fade away the movewith children of func_breakaway
#ifdef KMQUAKE2_ENGINE_MOD
void fade_child (edict_t *ent);
@ -3891,6 +3891,11 @@ void fade_children2 (edict_t *self)
}
}
}
// Gotta have this for extractfuncs...
void fade_child (edict_t *ent)
{
}
#endif
void train_blocked (edict_t *self, edict_t *other)

View file

@ -1859,6 +1859,65 @@ extern void thing_think_pause ( edict_t * self ) ;
extern void thing_think ( edict_t * self ) ;
extern void thing_restore_leader ( edict_t * self ) ;
extern edict_t * SpawnThing ( void ) ;
extern void SP_target_locator ( edict_t * self ) ;
extern void target_locator_init ( edict_t * self ) ;
extern void SP_target_failure ( edict_t * self ) ;
extern void use_target_failure ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void target_failure_fade_lights ( edict_t * self ) ;
extern void target_failure_think ( edict_t * self ) ;
extern void target_failure_player_die ( edict_t * player ) ;
extern void target_failure_wipe ( edict_t * self ) ;
extern void SP_target_animation ( edict_t * self ) ;
extern void target_animation_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void target_animate ( edict_t * ent ) ;
extern void SP_target_monitor ( edict_t * self ) ;
extern void use_target_monitor ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void target_monitor_move ( edict_t * self ) ;
extern void target_monitor_off ( edict_t * self ) ;
extern void SP_target_attractor ( edict_t * self ) ;
extern void use_target_attractor ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void target_attractor_think ( edict_t * self ) ;
extern void target_attractor_think_single ( edict_t * self ) ;
extern void SP_target_clone ( edict_t * self ) ;
extern void target_clone_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void clone ( edict_t * self ) ;
extern void SP_target_rocks ( edict_t * self ) ;
extern void target_rocks_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void ThrowRock ( edict_t * self , char * modelname , float speed , vec3_t origin , vec3_t size , int mass ) ;
extern void SP_target_fade ( edict_t * self ) ;
extern void use_target_fade ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void SP_target_sky ( edict_t * self ) ;
extern void target_sky_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void SP_target_skill ( edict_t * self ) ;
extern void use_target_skill ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void SP_target_cd ( edict_t * self ) ;
extern void target_cd_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void SP_target_rotation ( edict_t * self ) ;
extern void target_rotation_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void SP_target_change ( edict_t * self ) ;
extern void target_change_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void SP_target_movewith ( edict_t * self ) ;
extern void target_movewith_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void SP_target_effect ( edict_t * self ) ;
extern void target_effect_think ( edict_t * self ) ;
extern void target_effect_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void target_effect_widowbeam ( edict_t * self , edict_t * activator ) ;
extern void target_effect_tunnel_sparks ( edict_t * self , edict_t * activator ) ;
extern void target_effect_explosion ( edict_t * self , edict_t * activator ) ;
extern void target_effect_sparks ( edict_t * self , edict_t * activator ) ;
extern void target_effect_lightning ( edict_t * self , edict_t * activator ) ;
extern void target_effect_trail ( edict_t * self , edict_t * activator ) ;
extern void target_effect_splash ( edict_t * self , edict_t * activator ) ;
extern void target_effect_steam ( edict_t * self , edict_t * activator ) ;
extern void target_effect_at ( edict_t * self , edict_t * activator ) ;
extern void SP_target_global_text ( edict_t * self ) ;
extern void target_global_text_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void SP_target_set_effect ( edict_t * self ) ;
extern void target_set_effect_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void SP_target_command ( edict_t * self ) ;
extern void target_command_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void SP_target_monsterbattle ( edict_t * self ) ;
extern void use_target_monsterbattle ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void SP_target_earthquake ( edict_t * self ) ;
extern void target_earthquake_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void target_earthquake_think ( edict_t * self ) ;
@ -2111,71 +2170,12 @@ extern void SP_trigger_teleport ( edict_t * self ) ;
extern void trigger_teleport_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void trigger_teleport_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ;
extern void SP_info_teleport_destination ( edict_t * self ) ;
extern void SP_target_locator ( edict_t * self ) ;
extern void target_locator_init ( edict_t * self ) ;
extern void SP_target_failure ( edict_t * self ) ;
extern void use_target_failure ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void target_failure_fade_lights ( edict_t * self ) ;
extern void target_failure_think ( edict_t * self ) ;
extern void target_failure_player_die ( edict_t * player ) ;
extern void target_failure_wipe ( edict_t * self ) ;
extern void SP_target_animation ( edict_t * self ) ;
extern void target_animation_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void target_animate ( edict_t * ent ) ;
extern void SP_target_monitor ( edict_t * self ) ;
extern void use_target_monitor ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void target_monitor_move ( edict_t * self ) ;
extern void target_monitor_off ( edict_t * self ) ;
extern void SP_target_attractor ( edict_t * self ) ;
extern void use_target_attractor ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void target_attractor_think ( edict_t * self ) ;
extern void target_attractor_think_single ( edict_t * self ) ;
extern void SP_target_clone ( edict_t * self ) ;
extern void target_clone_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void clone ( edict_t * self ) ;
extern void SP_target_rocks ( edict_t * self ) ;
extern void target_rocks_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void ThrowRock ( edict_t * self , char * modelname , float speed , vec3_t origin , vec3_t size , int mass ) ;
extern void SP_target_fade ( edict_t * self ) ;
extern void use_target_fade ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void SP_target_sky ( edict_t * self ) ;
extern void target_sky_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void SP_target_skill ( edict_t * self ) ;
extern void use_target_skill ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void SP_target_cd ( edict_t * self ) ;
extern void target_cd_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void SP_target_rotation ( edict_t * self ) ;
extern void target_rotation_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void SP_target_change ( edict_t * self ) ;
extern void target_change_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void SP_target_movewith ( edict_t * self ) ;
extern void target_movewith_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void SP_target_effect ( edict_t * self ) ;
extern void target_effect_think ( edict_t * self ) ;
extern void target_effect_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void target_effect_widowbeam ( edict_t * self , edict_t * activator ) ;
extern void target_effect_tunnel_sparks ( edict_t * self , edict_t * activator ) ;
extern void target_effect_explosion ( edict_t * self , edict_t * activator ) ;
extern void target_effect_sparks ( edict_t * self , edict_t * activator ) ;
extern void target_effect_lightning ( edict_t * self , edict_t * activator ) ;
extern void target_effect_trail ( edict_t * self , edict_t * activator ) ;
extern void target_effect_splash ( edict_t * self , edict_t * activator ) ;
extern void target_effect_steam ( edict_t * self , edict_t * activator ) ;
extern void target_effect_at ( edict_t * self , edict_t * activator ) ;
extern void SP_target_global_text ( edict_t * self ) ;
extern void target_global_text_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void SP_target_set_effect ( edict_t * self ) ;
extern void target_set_effect_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void SP_target_command ( edict_t * self ) ;
extern void target_command_use ( edict_t * self , edict_t * activator , edict_t * other ) ;
extern void SP_target_orb ( edict_t * ent ) ;
extern void orb_think ( edict_t * self ) ;
extern void SP_target_blacklight ( edict_t * ent ) ;
extern void blacklight_think ( edict_t * self ) ;
extern void SP_target_killplayers ( edict_t * self ) ;
extern void target_killplayers_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void SP_target_monsterbattle ( edict_t * self ) ;
extern void use_target_monsterbattle ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void SP_target_anger ( edict_t * self ) ;
extern void target_anger_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void SP_target_steam ( edict_t * self ) ;
@ -2292,6 +2292,13 @@ extern void monster_fire_bullet ( edict_t * self , vec3_t start , vec3_t dir , i
extern qboolean M_SetDeath ( edict_t * self , mmove_t * * deathmoves ) ;
extern void FadeDieSink ( edict_t * ent ) ;
extern void FadeSink ( edict_t * ent ) ;
extern void SP_model_train_origin ( edict_t * self ) ;
extern void SP_model_train ( edict_t * self ) ;
extern void model_train_animator ( edict_t * animator ) ;
extern void SP_model_spawn ( edict_t * ent ) ;
extern void model_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ;
extern void model_spawn_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void modelspawn_think ( edict_t * self ) ;
extern void SP_misc_q1_fireball ( edict_t * self ) ;
extern void q1_fireball_fly ( edict_t * self ) ;
extern void q1_fireball_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ;
@ -2314,6 +2321,14 @@ extern void bubble_split ( edict_t * bubble ) ;
extern void bubble_touch ( edict_t * ent , edict_t * other , cplane_t * plane , csurface_t * surf ) ;
extern void SP_misc_q1_zombie_crucified ( edict_t * self ) ;
extern void misc_zombie_crucified_think ( edict_t * self ) ;
extern void SP_monster_coco_monkey ( edict_t * self ) ;
extern void monster_coco_monkey_think ( edict_t * self ) ;
extern void SP_light_flame2s ( edict_t * self ) ;
extern void SP_light_flame2 ( edict_t * self ) ;
extern void SP_light_flame1s ( edict_t * self ) ;
extern void SP_light_flame1 ( edict_t * self ) ;
extern void light_flame_spawn ( edict_t * self ) ;
extern void light_flame_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern int PatchDeadSoldier ( void ) ;
extern void SP_target_fountain ( edict_t * ent ) ;
extern void target_fountain_delayed_use ( edict_t * self ) ;
@ -2332,14 +2347,6 @@ extern void drop_add_to_chain ( edict_t * drop ) ;
extern void SP_misc_light ( edict_t * self ) ;
extern void misc_light_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void misc_light_think ( edict_t * self ) ;
extern void SP_monster_coco_monkey ( edict_t * self ) ;
extern void monster_coco_monkey_think ( edict_t * self ) ;
extern void SP_light_flame2s ( edict_t * self ) ;
extern void SP_light_flame2 ( edict_t * self ) ;
extern void SP_light_flame1s ( edict_t * self ) ;
extern void SP_light_flame1 ( edict_t * self ) ;
extern void light_flame_spawn ( edict_t * self ) ;
extern void light_flame_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void SP_misc_gekk_writhe ( edict_t * self ) ;
extern void misc_gekk_writhe_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void misc_gekk_writhe_think ( edict_t * self ) ;
@ -2488,13 +2495,6 @@ extern void ClipGibVelocity ( edict_t * ent ) ;
extern void VelocityForDamage ( int damage , vec3_t v ) ;
extern void SP_func_areaportal ( edict_t * ent ) ;
extern void Use_Areaportal ( edict_t * ent , edict_t * other , edict_t * activator ) ;
extern void SP_model_train_origin ( edict_t * self ) ;
extern void SP_model_train ( edict_t * self ) ;
extern void model_train_animator ( edict_t * animator ) ;
extern void SP_model_spawn ( edict_t * ent ) ;
extern void model_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ;
extern void model_spawn_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void modelspawn_think ( edict_t * self ) ;
extern void Cmd_Trigger_f ( edict_t * ent ) ;
extern void SP_light_flame ( edict_t * self ) ;
extern void bigflame_think ( edict_t * self ) ;

View file

@ -166,11 +166,12 @@ void fd_secret_move6 (edict_t *self)
// added sound
if (self->moveinfo.sound_start)
gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_start, 1, self->attenuation, 0); // was ATTN_STATIC
if (self->moveinfo.sound_middle)
if (self->moveinfo.sound_middle) {
self->s.sound = self->moveinfo.sound_middle;
#ifdef LOOP_SOUND_ATTENUATION
self->s.attenuation = self->attenuation;
#endif
}
self->moveinfo.state = STATE_DOWN;
Move_Calc (self, self->pos0, fd_secret_done);

View file

@ -350,7 +350,7 @@ void InitLithiumVars (void)
turn_rider = gi.cvar("turn_rider", "1", CVAR_ARCHIVE);
adjust_train_corners = gi.cvar("adjust_train_corners", "0", CVAR_ARCHIVE);
ion_ripper_extra_sounds = gi.cvar("ion_ripper_extra_sounds", "1", CVAR_ARCHIVE);
ion_ripper_extra_sounds = gi.cvar("ion_ripper_extra_sounds", "0", CVAR_ARCHIVE);
add_velocity_throw = gi.cvar("add_velocity_throw", "0", CVAR_ARCHIVE);
falling_armor_damage = gi.cvar("falling_armor_damage", "0", CVAR_ARCHIVE);
player_jump_sounds = gi.cvar("player_jump_sounds", "1", CVAR_ARCHIVE);

View file

@ -1387,8 +1387,8 @@ void G_SetClientSound (edict_t *ent)
// RAFAEL
else if (strcmp (weap, "weapon_phalanx") == 0)
ent->s.sound = gi.soundindex ("weapons/phaloop.wav");
//Knightmare - ambient sounds for ION Ripper and Shockwave
else if (strcmp (weap, "weapon_boomer") == 0)
// Knightmare - ambient sounds for ION Ripper and Shockwave
else if ( (strcmp (weap, "weapon_boomer") == 0) && ion_ripper_extra_sounds->value)
ent->s.sound = gi.soundindex ("weapons/ion_hum.wav");
else if (strcmp (weap, "weapon_shockwave") == 0)
ent->s.sound = gi.soundindex ("weapons/shock_hum.wav");

View file

@ -703,7 +703,7 @@ void Weapon_Generic (edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST,
}
// Knightmare- activate and putaway sounds for ION Ripper and Shockwave
if (ion_ripper_extra_sounds->value && !strcmp (ent->client->pers.weapon->pickup_name, "ION Ripper"))
if (!strcmp (ent->client->pers.weapon->pickup_name, "ION Ripper") && ion_ripper_extra_sounds->value)
{
if (ent->client->ps.gunframe == 0)
gi.sound (ent, CHAN_AUTO, gi.soundindex("weapons/ionactive.wav"), 1.0, ATTN_NORM, 0);