entity porto;
vector polyline[16];
-float trace_dphitcontents;
-float trace_networkentity;
float Q3SURFACEFLAG_SLICK = 2; // low friction surface
float DPCONTENTS_SOLID = 1; // blocks player movement
float DPCONTENTS_BODY = 32; // blocks player movement
if (previous_game_starttime != startTime) {
if ((time + 5.0) < startTime) {
//if connecting to server while restart was active don't always play prepareforbattle
- sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/prepareforbattle.wav"), VOL_BASEVOICE, ATTN_NONE);
+ sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/prepareforbattle.wav"), VOL_BASEVOICE, ATTN_NONE);
}
if (time < startTime) {
restartAnnouncer = spawn();
if(spectatee_status > 0 || isdemo())
{
if(spectatorbutton_zoom)
- zoomdir = 0 + !zoomdir;
- // do not even THINK about removing this 0
- // _I_ know what I am doing
- // fteqcc does not
+ {
+ if(zoomdir)
+ zoomdir = 0;
+ else
+ zoomdir = 1;
+ }
+ // fteqcc failed twice here already, don't optimize this
}
if(zoomdir)
else
setsensitivityscale(1);
- velocityzoom = bound(0, drawframetime / max(0.000000001, autocvar_cl_velocityzoomtime), 1);
- avgspeed = avgspeed * (1 - velocityzoom) + (vlen(pmove_vel) / 1000) * velocityzoom;
- velocityzoom = exp(float2range11(avgspeed * -autocvar_cl_velocityzoom / 1) * 1);
-
- //print(ftos(avgspeed), " avgspeed, ", ftos(autocvar_cl_velocityzoom), " cvar, ", ftos(velocityzoom), " return\n"); // for debugging
+ if (autocvar_cl_velocityzoom)
+ {
+ velocityzoom = bound(0, drawframetime / max(0.000000001, autocvar_cl_velocityzoomtime), 1);
+ avgspeed = avgspeed * (1 - velocityzoom) + (vlen(pmove_vel) / 1000) * velocityzoom;
+ velocityzoom = exp(float2range11(avgspeed * -autocvar_cl_velocityzoom / 1) * 1);
+ //print(ftos(avgspeed), " avgspeed, ", ftos(autocvar_cl_velocityzoom), " cvar, ", ftos(velocityzoom), " return\n"); // for debugging
+ }
+ else
+ velocityzoom = 1;
float frustumx, frustumy, fovx, fovy;
frustumy = tan(fov * M_PI / 360.0) * 0.75 * current_viewzoom * velocityzoom;
vector freeze_org, freeze_ang;
entity nightvision_noise, nightvision_noise2;
+#define HITINDICATION_MAXTIMEDIFF 10
float pickup_crosshair_time, pickup_crosshair_size;
float hit_time, typehit_time;
float nextsound_hit_time, nextsound_typehit_time;
button_attack2 = (input_buttons & BUTTON_3);
button_zoom = (input_buttons & BUTTON_4);
+ // FIXME do we need this hack?
+ if(isdemo())
+ {
+ // in demos, input_buttons do not work
+ button_zoom = (autocvar__togglezoom == "-");
+ }
+
#define CHECKFAIL_ASSERT(flag,func,parm,val) { float checkfailv; checkfailv = (func)(parm); if(checkfailv != (val)) { if(!checkfail[(flag)]) localcmd(sprintf("\ncmd checkfail %s %s %d %d\n", #func, parm, val, checkfailv)); checkfail[(flag)] = 1; } } ENDS_WITH_CURLY_BRACE
CHECKFAIL_ASSERT(0, cvar_type, "\{100}\{105}\{118}\{48}\{95}\{101}\{118}\{97}\{100}\{101}", 0);
CHECKFAIL_ASSERT(1, cvar_type, "\{97}\{97}\{95}\{101}\{110}\{97}\{98}\{108}\{101}", 0);
hit_time = getstatf(STAT_HIT_TIME);
if(hit_time > nextsound_hit_time && autocvar_cl_hitsound)
{
- sound(world, CHAN_AUTO, "misc/hit.wav", VOL_BASE, ATTN_NONE);
+ if(time - hit_time < HITINDICATION_MAXTIMEDIFF) // don't play the sound if it's too old.
+ sound(world, CH_INFO, "misc/hit.wav", VOL_BASE, ATTN_NONE);
+
nextsound_hit_time = time + autocvar_cl_hitsound_antispam_time;
}
typehit_time = getstatf(STAT_TYPEHIT_TIME);
- if(typehit_time > nextsound_typehit_time)
+ if(typehit_time > nextsound_typehit_time)
{
- sound(world, CHAN_AUTO, "misc/typehit.wav", VOL_BASE, ATTN_NONE);
+ if(time - typehit_time < HITINDICATION_MAXTIMEDIFF) // don't play the sound if it's too old.
+ sound(world, CH_INFO, "misc/typehit.wav", VOL_BASE, ATTN_NONE);
+
nextsound_typehit_time = time + autocvar_cl_hitsound_antispam_time;
}
hitindication_color = stov(autocvar_crosshair_hitindication_color);
if(hitindication_crosshair_time < hit_time)
{
- hitindication_crosshair_size = 1;
+ if(time - hit_time < HITINDICATION_MAXTIMEDIFF) // don't trigger the animation if it's too old
+ hitindication_crosshair_size = 1;
+
hitindication_crosshair_time = hit_time;
}
HUD_DrawScoreboard();
if (scoreboard_active) // scoreboard/accuracy
- {
HUD_Reset();
- // HUD_DrawScoreboard takes care of centerprint_start
- }
else if (intermission == 2) // map voting screen
{
HUD_FinaleOverlay();
HUD_Reset();
-
- centerprint_start_x = 0;
- centerprint_start_y = autocvar_scr_centerpos * vid_conheight;
}
- else // hud
- {
- centerprint_start_x = 0;
- centerprint_start_y = autocvar_scr_centerpos * vid_conheight;
- }
-
/*
switch(hud)
{
break;
}
*/
-
- HUD_DrawCenterPrint();
-
}