- SW: make ambients start properly.

This fell victim to some fudging code that was needed to avoid crashes with the original game loop.
All that fudging could easily be removed now because nothing of it is needed anymore.
This commit is contained in:
Christoph Oelckers 2020-09-18 00:33:18 +02:00
parent af298411df
commit 77a2bcb958
3 changed files with 5 additions and 14 deletions

View file

@ -620,15 +620,6 @@ void GameInterface::NewGame(MapRecord *map, int skill)
void GameInterface::Ticker(void)
{
if (SavegameLoaded)
{
InitLevelGlobals();
SavegameLoaded = false;
// contains what is needed from calls below
if (snd_ambience)
StartAmbientSound();
}
int i;
TRAVERSE_CONNECT(i)
{

View file

@ -66,6 +66,8 @@ TO DO
//////////////////////////////////////////////////////////////////////////////
*/
void InitLevelGlobals(void);
extern int lastUpdate;
extern char SaveGameDescr[10][80];
extern int PlayClock;
@ -641,8 +643,6 @@ bool GameInterface::SaveGame(FSaveGameNode *sv)
}
extern bool SavegameLoaded;
bool GameInterface::LoadGame(FSaveGameNode* sv)
{
MFILE_READ fil;
@ -1075,7 +1075,7 @@ bool GameInterface::LoadGame(FSaveGameNode* sv)
DoPlayerDivePalette(Player+myconnectindex);
DoPlayerNightVisionPalette(Player+myconnectindex);
SavegameLoaded = true;
InitLevelGlobals();
return true;
}

View file

@ -280,9 +280,9 @@ void InitAmbient(int num, SPRITEp sp)
void StartAmbientSound(void)
{
short i, nexti;
int i, nexti;
if (gamestate != GS_LEVEL || !SoundEnabled()) return; // Don't restart ambience if no level is active! Will crash game.
if (!SoundEnabled()) return;
TRAVERSE_SPRITE_STAT(headspritestat[STAT_AMBIENT], i, nexti)
{