@@ -317,30 +317,6 @@ string GetGrenTimerSound() {
317
317
return wav;
318
318
}
319
319
320
- void OldPlayGren(float offset) {
321
- local float channel = CHAN_GREN_START;
322
- local float soundtime;
323
- local float highest_soundtime = -1;
324
-
325
- for(float i = CHAN_GREN_START; i <= CHAN_GREN_END; i++) {
326
- soundtime = getsoundtime(world, i);
327
-
328
- if (soundtime < 0) {
329
- channel = i;
330
- break;
331
- }
332
-
333
- if (soundtime > highest_soundtime) {
334
- highest_soundtime = soundtime;
335
- channel = i;
336
- }
337
- }
338
-
339
- local string wav = GetGrenTimerSound();
340
- localsound(wav, channel, CVARF(FOCMD_GRENTIMERVOLUME)); // required because soundupdate doesn't reset getsoundtime
341
- soundupdate(self, channel, wav, CVARF(FOCMD_GRENTIMERVOLUME), 0, 0, 0, offset);
342
- }
343
-
344
320
void CsGrenTimer::Set(float primed_at, float expires_at, float _grentype,
345
321
float timer_flags) {
346
322
grentype_ = _grentype;
@@ -377,11 +353,6 @@ void StopGrenTimers() {
377
353
// New style.
378
354
for (float i = 0; i < NUM_GREN_TIMERS; i++)
379
355
grentimers[i].Stop();
380
-
381
- // Old style.
382
- for (float i = CHAN_GREN_START; i <= CHAN_GREN_END; i++) {
383
- soundupdate(self, i, "", 0, 0, 0, 0, 0);
384
- }
385
356
}
386
357
387
358
void ParseGrenPrimed(float grentype, float primed_at, float explodes_at) {
@@ -400,32 +371,19 @@ void ParseGrenPrimed(float grentype, float primed_at, float explodes_at) {
400
371
}
401
372
402
373
float debug_print_state = CVARF(fo_grentimer_debug) & 1;
403
- float debug_use_old_sound = CVARF(fo_grentimer_debug) & 4;
404
-
405
- float play_old_sound = FALSE;
406
- if (debug_use_old_sound) {
407
- play_old_sound = timer_flags & FL_GT_SOUND;
408
- timer_flags &= ~FL_GT_SOUND;
409
- }
410
374
411
375
CsGrenTimer timer = CsGrenTimer::GetNext();
412
376
timer.Set(primed_at, explodes_at, grentype, timer_flags);
413
377
414
- if (play_old_sound)
415
- OldPlayGren(timer.sound_offset());
416
-
417
378
if (debug_print_state) {
418
379
float ping = getplayerkeyfloat(player_localnum, INFOKEY_P_PING) / 1000;
419
380
420
381
float expires_old = time + 3.8 - ping;
421
382
float expires_new = timer.expiry();
422
383
float expires_ideal = explodes_at - ping/2;
423
384
424
- print(sprintf("primed_at=%0.2f explodes_at=%0.2f fuse=%0.2f new=%d\n",
425
- primed_at, explodes_at, explodes_at - primed_at,
426
- !debug_use_old_sound));
427
- print(sprintf("ideal=%0.2f new=%0.2f old=%0.2f\n",
428
- expires_ideal, expires_new, expires_old));
385
+ print(sprintf("primed_at=%0.2f explodes_at=%0.2f fuse=%0.2f\n",
386
+ primed_at, explodes_at, explodes_at - primed_at));
429
387
}
430
388
}
431
389
0 commit comments