Add functions for storing and restoring globals

This commit is contained in:
8dcc 2023-07-21 07:02:26 +02:00
parent 80242d0a3f
commit e86f10ec9f
2 changed files with 16 additions and 0 deletions

View File

@ -37,5 +37,19 @@ bool globals_init(void) {
return false;
}
globals_store();
return true;
}
void globals_store(void) {
o_engine = *i_engine;
o_client = *i_client;
o_pmove = *i_pmove;
}
void globals_restore(void) {
*i_engine = o_engine;
*i_client = o_client;
*i_pmove = o_pmove;
}

View File

@ -34,5 +34,7 @@ extern cl_entity_t* localplayer;
/*----------------------------------------------------------------------------*/
bool globals_init(void);
void globals_store(void);
void globals_restore(void);
#endif /* _GLOBALS_H */