Skip to content

Commit bb266f1

Browse files
author
newby
committed
Roll everyone over to the new timer implementation by default
Last step before deleting the old code and merging to master, everything seems to be working well for people now. Also confirmed that there was an FTE use-after-free bug in reading the grenade timer sound from cvar that was occasionally resulting in crashes. That bug is being fixed FTE side and our migration to auto-cvar in the meanwhile is sufficient to fix on ourside. This fixes client hitches so let's make sure everyone gets it again.
1 parent 6ff5de4 commit bb266f1

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

csqc/events.qc

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -310,15 +310,9 @@ string cached_timer;
310310
string GetGrenTimerSound() {
311311
string wav = CVARS(FOCMD_GRENTIMERSOUND);
312312

313-
// The string NE-uop below is suspect in crashes. Possible interaction
314-
// with cvar_string implementation. Hopefully the migration to autocvar
315-
// resolves this, but also put it behind a debug control temporarily so we
316-
// can test with/without.
317-
if (CVARF(fo_grentimer_debug) & 8 == 1) {
318-
if (cached_timer != wav) {
319-
precache_sound(wav);
320-
cached_timer = wav;
321-
}
313+
if (cached_timer != wav) {
314+
precache_sound(wav);
315+
cached_timer = wav;
322316
}
323317
return wav;
324318
}
@@ -406,10 +400,10 @@ void ParseGrenPrimed(float grentype, float primed_at, float explodes_at) {
406400
}
407401

408402
float debug_print_state = CVARF(fo_grentimer_debug) & 1;
409-
float debug_use_new_sound = CVARF(fo_grentimer_debug) & 2;
403+
float debug_use_old_sound = CVARF(fo_grentimer_debug) & 4;
410404

411405
float play_old_sound = FALSE;
412-
if (!debug_use_new_sound) {
406+
if (debug_use_old_sound) {
413407
play_old_sound = timer_flags & FL_GT_SOUND;
414408
timer_flags &= ~FL_GT_SOUND;
415409
}
@@ -429,7 +423,7 @@ void ParseGrenPrimed(float grentype, float primed_at, float explodes_at) {
429423

430424
print(sprintf("primed_at=%0.2f explodes_at=%0.2f fuse=%0.2f new=%d\n",
431425
primed_at, explodes_at, explodes_at - primed_at,
432-
debug_use_new_sound));
426+
!debug_use_old_sound));
433427
print(sprintf("ideal=%0.2f new=%0.2f old=%0.2f\n",
434428
expires_ideal, expires_new, expires_old));
435429
}

0 commit comments

Comments
 (0)