yquake2remaster/src/game
Yamagi bd97725a3d Fix savegame backward compatibility after cfb86ac.
The steps when loading a savegame are:

1. The server loads the map.
2. Loading the map spawns all entities, i.e. their spawn func is called.
   This loads the models, precaches the sounds, etc.
3. The savegame is loaded and all the entities in the edict are replaced
   by the entities read from game.ssv.

When the monster footstep sound were added in cfb86ac, new sounds were
added to the spawn functions of most monster entities. This alters the
sound indices of all sounds precached at a later time. When a savegame
from an older version is loaded, the entities read from game.svv still
reference the old sound indices. This leads to the wrong sound getting
played.

Work around this by lazy loading the footstep sounds. Instead of loading
(precaching) them in the spawn function, load them at their first use.
This has the nice side effect of preventing the "missing sound" messages
when running without the footsteps.pkz file in baseq2/. It might lead to
short stuttering when the sound is played for the first time, though.

Closes #917.
2022-10-18 07:40:47 +02:00
..
header game: sync functions definitions 2022-09-18 12:39:50 +03:00
monster Fix savegame backward compatibility after cfb86ac. 2022-10-18 07:40:47 +02:00
player Merge pull request #906 from BjossiAlfreds/powercubes 2022-10-08 15:24:40 +02:00
savegame Bumb game version value 2022-09-18 12:39:50 +03:00
g_ai.c game: sync functions definitions 2022-09-18 12:39:50 +03:00
g_chase.c Some minor cleanup/tuning/commenting 2013-04-14 18:46:08 +02:00
g_cmds.c Merge pull request #902 from BjossiAlfreds/flood 2022-10-08 15:21:23 +02:00
g_combat.c PVS Studio fixes for game/ 2020-02-10 17:55:41 +01:00
g_func.c Fix door_go_up(), G_UseTargets() exiting early if no activator is given. 2022-02-05 17:02:24 +01:00
g_items.c Merge pull request #906 from BjossiAlfreds/powercubes 2022-10-08 15:24:40 +02:00
g_main.c Bumb game version value 2022-09-18 12:39:50 +03:00
g_misc.c habdful of little simplifications. 2022-02-27 09:03:06 +00:00
g_monster.c Console warning and fix for triggered monsters with no targetname 2021-03-28 17:16:36 +00:00
g_phys.c Merge pull request #909 from BjossiAlfreds/collision 2022-10-08 15:32:23 +02:00
g_spawn.c game: sync functions definitions 2022-09-18 12:39:50 +03:00
g_svcmds.c game: sync functions definitions 2022-09-18 12:39:50 +03:00
g_target.c game: sync functions definitions 2022-09-18 12:39:50 +03:00
g_trigger.c Revert "Cleanup vector math" 2015-10-19 18:20:47 +02:00
g_turret.c Sync LoadSP2, turret_driver_die, SP_info_player_intermission declarations 2020-12-16 22:44:38 +02:00
g_utils.c game: sync functions definitions 2022-09-18 12:39:50 +03:00
g_weapon.c Easier handling of skill levels by using defines instead of numbers 2020-01-22 12:57:37 -03:00