mirror of
https://github.com/blendogames/thirtyflightsofloving.git
synced 2025-01-31 04:30:39 +00:00
Fix crash in fog code when loading save from different/incompatible game DLL. Add support for game DLLs compiled for current development version.
Fixed crash in Fog_Off() when called from ShutdownGame(), typically when trying to load an incompatible savegame from a different (or different version) game DLL. Added filesytem function exports to game DLL from development branch to support game DLLs compiled for that version.
This commit is contained in:
parent
f986267ae2
commit
09bcccf8bf
8 changed files with 58 additions and 23 deletions
20
.gitignore
vendored
Normal file
20
.gitignore
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
# ignore all make dependency files and linux object binaries
|
||||
*.d
|
||||
*.o
|
||||
bin/
|
||||
|
||||
# ignore all the windows binaries - they shouldn't be committed!
|
||||
Debug/
|
||||
Release/
|
||||
x64/
|
||||
.vs/
|
||||
*.log
|
||||
*.ncb
|
||||
*.opt
|
||||
*.plg
|
||||
*.suo
|
||||
*.user
|
||||
*.aps
|
||||
*.clw
|
||||
*.pdb
|
||||
*.ilk
|
19
game/g_fog.c
19
game/g_fog.c
|
@ -41,11 +41,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#ifdef DISABLE_FOG
|
||||
|
||||
void Fog_Init() {}
|
||||
void Fog_Init (void) {}
|
||||
void Fog (edict_t *ent) {}
|
||||
void Fog_Off () {}
|
||||
void Fog_ConsoleFog () {}
|
||||
void GLFog () {}
|
||||
void Fog_Off (qboolean gameShutdown) {}
|
||||
void Fog_ConsoleFog (void) {}
|
||||
void GLFog (void) {}
|
||||
void trig_fog_fade (edict_t *self) {}
|
||||
void init_trigger_fog_delay (edict_t *self) {}
|
||||
void fog_fade (edict_t *self) {}
|
||||
|
@ -74,7 +74,7 @@ NEW FOG SYSTEM
|
|||
=================================================
|
||||
*/
|
||||
|
||||
void Fog_Off (edict_t *player_ent)
|
||||
void Client_Fog_Off (edict_t *player_ent)
|
||||
{
|
||||
if (!player_ent->client || player_ent->is_bot)
|
||||
return;
|
||||
|
@ -611,7 +611,7 @@ void Fog (edict_t *ent) //vec3_t viewpoint)
|
|||
if (!level.active_fog)
|
||||
{
|
||||
if (level.last_active_fog)
|
||||
Fog_Off();
|
||||
Fog_Off (false);
|
||||
level.last_active_fog = 0;
|
||||
return;
|
||||
}
|
||||
|
@ -635,7 +635,7 @@ void Fog (edict_t *ent) //vec3_t viewpoint)
|
|||
level.last_active_fog = level.active_fog;
|
||||
}
|
||||
|
||||
void Fog_Off (void)
|
||||
void Fog_Off (qboolean gameShutdown)
|
||||
{
|
||||
if (deathmatch->value || coop->value)
|
||||
return;
|
||||
|
@ -644,6 +644,11 @@ void Fog_Off (void)
|
|||
{
|
||||
edict_t *player_ent = &g_edicts[1];
|
||||
|
||||
// If game is shutting down, g_edicts will likely be invalid
|
||||
// and the client will clear the fog automatically
|
||||
if (gameShutdown)
|
||||
return;
|
||||
|
||||
if (!player_ent->client || player_ent->is_bot)
|
||||
return;
|
||||
|
||||
|
|
|
@ -1113,7 +1113,7 @@ extern void model_die ( edict_t * self , edict_t * inflictor , edict_t * attacke
|
|||
extern void model_spawn_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
|
||||
extern void modelspawn_think ( edict_t * self ) ;
|
||||
extern void PrecacheDebris ( int type ) ;
|
||||
extern int PatchDeadSoldier ( ) ;
|
||||
extern int PatchDeadSoldier ( void ) ;
|
||||
extern void SP_target_fountain ( edict_t * ent ) ;
|
||||
extern void target_fountain_delayed_use ( edict_t * self ) ;
|
||||
extern void target_fountain_use ( edict_t * ent , edict_t * other , edict_t * activator ) ;
|
||||
|
@ -1462,7 +1462,7 @@ extern void SP_target_fog ( edict_t * self ) ;
|
|||
extern void target_fog_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
|
||||
extern void fog_fade ( edict_t * self ) ;
|
||||
extern void Fog_Init ( void ) ;
|
||||
extern void Fog_Off ( void ) ;
|
||||
extern void Fog_Off ( qboolean gameShutdown ) ;
|
||||
extern void Fog ( edict_t * ent ) ;
|
||||
extern void init_trigger_fog_delay ( edict_t * self ) ;
|
||||
extern void trig_fog_fade ( edict_t * self ) ;
|
||||
|
|
|
@ -960,10 +960,10 @@ void Moving_Speaker_Think(edict_t *ent);
|
|||
#define MAX_FOGS 16
|
||||
extern fog_t gfogs[MAX_FOGS];
|
||||
void Cmd_Fog_f (edict_t *ent);
|
||||
void Fog_Init();
|
||||
void Fog_Init (void);
|
||||
void Fog (edict_t *ent); //vec3_t viewpoint);
|
||||
void Fog_Off();
|
||||
void Fog_SetFogParms();
|
||||
void Fog_Off (qboolean gameShutdown);
|
||||
void Fog_SetFogParms (void);
|
||||
//
|
||||
// g_func.c
|
||||
//
|
||||
|
|
|
@ -165,7 +165,7 @@ void ShutdownGame (void)
|
|||
}
|
||||
// Lazarus: Turn off fog if it's on
|
||||
if (!dedicated->value)
|
||||
Fog_Off();
|
||||
Fog_Off (true);
|
||||
|
||||
gi.FreeTags (TAG_LEVEL);
|
||||
gi.FreeTags (TAG_GAME);
|
||||
|
|
13
game/game.h
13
game/game.h
|
@ -198,11 +198,14 @@ typedef struct
|
|||
int (*LoadFile) (char *name, void **buf);
|
||||
void (*FreeFile) (void *buf);
|
||||
void (*FreeFileList) (char **list, int n);
|
||||
// int (*OpenFile) (const char *name, fileHandle_t *f, fsMode_t mode);
|
||||
// int (*OpenCompressedFile) (const char *zipName, const char *fileName, fileHandle_t *f, fsMode_t mode);
|
||||
// void (*CloseFile) (fileHandle_t f);
|
||||
// int (*FRead) (void *buffer, int size, fileHandle_t f);
|
||||
// int (*FWrite) (const void *buffer, int size, fileHandle_t f);
|
||||
int (*OpenFile) (const char *name, fileHandle_t *f, fsMode_t mode);
|
||||
int (*OpenCompressedFile) (const char *zipName, const char *fileName, fileHandle_t *f, fsMode_t mode);
|
||||
void (*CloseFile) (fileHandle_t f);
|
||||
int (*FRead) (void *buffer, int size, fileHandle_t f);
|
||||
int (*FWrite) (const void *buffer, int size, fileHandle_t f);
|
||||
char *(*GameDir) (void);
|
||||
char *(*SaveGameDir) (void);
|
||||
void (*CreatePath) (char *path);
|
||||
#endif
|
||||
|
||||
} game_import_t;
|
||||
|
|
|
@ -2088,7 +2088,7 @@ void ClientBegin (edict_t *ent)
|
|||
return;
|
||||
}
|
||||
|
||||
Fog_Off();
|
||||
Fog_Off (false);
|
||||
|
||||
stuffcmd(ent,"alias +zoomin zoomin;alias -zoomin zoominstop\n");
|
||||
stuffcmd(ent,"alias +zoomout zoomout;alias -zoomout zoomoutstop\n");
|
||||
|
|
|
@ -405,6 +405,14 @@ void SV_InitGameProgs (void)
|
|||
import.LoadFile = FS_LoadFile;
|
||||
import.FreeFile = FS_FreeFile;
|
||||
import.FreeFileList = FS_FreeFileList;
|
||||
import.OpenFile = FS_FOpenFile;
|
||||
import.OpenCompressedFile = FS_FOpenCompressedFile;
|
||||
import.CloseFile = FS_FCloseFile;
|
||||
import.FRead = FS_Read;
|
||||
import.FWrite = FS_Write;
|
||||
import.GameDir = FS_GameDir;
|
||||
import.SaveGameDir = FS_GameDir;
|
||||
import.CreatePath = FS_CreatePath;
|
||||
|
||||
import.SetAreaPortalState = CM_SetAreaPortalState;
|
||||
import.AreasConnected = CM_AreasConnected;
|
||||
|
@ -419,4 +427,3 @@ void SV_InitGameProgs (void)
|
|||
|
||||
ge->Init ();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue