void PostInit(void);\r
void CSQC_Demo_Camera();\r
float Sbar_WouldDrawScoreboard ();\r
+float last_health, last_spectatee;\r
float view_set;\r
float camera_mode;\r
float reticle_type;\r
float chase_active_old;\r
float artwork_fade;\r
-float pickup_crosshair_time, pickup_crosshair_size, pickup_flash_time, vore_flash_laststate, respawn_flash_lasthealth;\r
+float pickup_crosshair_time, pickup_crosshair_size, pickup_flash_time, vore_flash_laststate;\r
float myhealth, myhealth_prev, myhealth_flash;\r
float contentavgalpha, liquidalpha_prev;\r
float old_blurradius, old_bluralpha, old_sharpen_intensity;\r
-float stomachsplash_alpha, stomachsplash_remove_at_respawn;\r
+float stomachsplash_alpha;\r
float volume_modify_1, volume_modify_2, volume_modify_default_1, volume_modify_default_2;\r
float volume_modify_changed_1, volume_modify_changed_2;\r
float eventchase_current_distance;\r
float f, i, j;\r
vector v, vo;\r
float a;\r
+ float respawned;\r
\r
vector reticle_pos, reticle_size;\r
vector splash_pos, splash_size;\r
pmove_org = warpzone_fixview_origin - vo;\r
input_angles = warpzone_fixview_angles;\r
\r
+ if(last_health <= 0 && getstati(STAT_HEALTH) > 0)\r
+ if not(spectatee_status > 0 && last_spectatee != spectatee_status) // not if we switched players and that detects a different health\r
+ respawned = TRUE; // stays true for one frame\r
+\r
// event chase camera\r
if(cvar("chase_active") <= 0) // greater than 0 means it's enabled manually, and this code is skipped\r
{\r
else\r
stomachsplash_alpha = 0;\r
}\r
- if(getstati(STAT_HEALTH) <= 0)\r
- stomachsplash_remove_at_respawn = 1; // schedule the effect to be removed next respawn\r
\r
- if(getstati(STAT_HEALTH) > 0 && stomachsplash_remove_at_respawn)\r
- stomachsplash_alpha = stomachsplash_remove_at_respawn = 0; // we respawned, remove the effect\r
+ if(respawned)\r
+ stomachsplash_alpha = 0; // we respawned, remove the effect\r
if(spectatee_status == -1)\r
stomachsplash_alpha = 0;\r
\r
pickup_flash_time = getstatf(STAT_LAST_PICKUP);\r
}\r
if(cvar("cl_flash_vore"))\r
+ if(!respawned) // guards against a bug\r
+ if not(spectatee_status > 0 && last_spectatee != spectatee_status) // not if we switched players and that detects a different stomach load\r
{\r
float vore_flash_state;\r
if(getstati(STAT_VORE_EATEN))\r
vore_flash_laststate = vore_flash_state;\r
}\r
if(cvar("cl_flash_respawn"))\r
- {\r
- float respawn_flash_health;\r
- respawn_flash_health = getstati(STAT_HEALTH);\r
-\r
- if(respawn_flash_lasthealth <= 0 && respawn_flash_health > 0)\r
- localcmd(strcat("bf ", cvar_string("cl_flash_respawn_color"), " ", cvar_string("cl_flash_respawn"), "\n"));\r
-\r
- respawn_flash_lasthealth = respawn_flash_health;\r
- }\r
+ if(respawned)\r
+ localcmd(strcat("bf ", cvar_string("cl_flash_respawn_color"), " ", cvar_string("cl_flash_respawn"), "\n"));\r
\r
if not(getstati(STAT_VORE_EATEN)) // crosshair is useless if we're in the stomach\r
{\r
localcmd("sendcvar chase_active\n");\r
chase_active_old = cvar("chase_active");\r
}\r
+\r
+ // update some stats to be detected next frame\r
+ last_health = getstati(STAT_HEALTH);\r
+ last_spectatee = spectatee_status;\r
}\r
\r
void Sbar_Draw();\r