Skip to content

Commit

Permalink
SERVER: Prevent Zombie sounds from triggering during spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
MotoLegacy committed Nov 26, 2024
1 parent 368e8e7 commit b3c2588
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/server/ai/zombie_core.qc
Original file line number Diff line number Diff line change
Expand Up @@ -1962,6 +1962,12 @@ void(entity where) spawn_a_zombieB =

// set up timer for next spawn
zombie_spawn_timer = zombie_spawn_delay + time;

// Depending on how fast AI processes, sometimes Zombie_AI() will execute
// while we are still at the world origin temporarily. This can cause us
// to play a sound at the origin, so add a small delay to prevent this.
// (and randomize it a bit).
szombie.sound_time = time + (random() * 2) + 3;
};

void() zombie_dummy =
Expand Down

0 comments on commit b3c2588

Please sign in to comment.