forked from github/server
Move the gamedb to a separate file.
This commit is contained in:
parent
8cccef41ad
commit
274d44ee18
|
@ -97,6 +97,7 @@ set (ERESSEA_SRC
|
|||
economy.c
|
||||
eressea.c
|
||||
exparse.c
|
||||
gamedb.c
|
||||
give.c
|
||||
guard.c
|
||||
items.c
|
||||
|
|
|
@ -39,18 +39,6 @@
|
|||
/* manually free() everything at exit? */
|
||||
#undef CLEANUP_CODE
|
||||
|
||||
void game_write_dbstate(void)
|
||||
{
|
||||
faction *f;
|
||||
|
||||
for (f = factions; f; f = f->next) {
|
||||
int uid = dblib_save_faction(f, turn);
|
||||
if (uid > 0) {
|
||||
f->uid = uid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void game_done(void)
|
||||
{
|
||||
log_dead_factions();
|
||||
|
|
|
@ -6,7 +6,6 @@ extern "C" {
|
|||
|
||||
void game_init(void);
|
||||
void game_done(void);
|
||||
void game_write_dbstate(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#ifdef _MSC_VER
|
||||
#include <platform.h>
|
||||
#endif
|
||||
|
||||
#include "gamedb.h"
|
||||
|
||||
#include "kernel/database.h"
|
||||
#include "kernel/faction.h"
|
||||
|
||||
void gamedb_update(void)
|
||||
{
|
||||
faction *f;
|
||||
|
||||
for (f = factions; f; f = f->next) {
|
||||
int uid = dblib_save_faction(f, turn);
|
||||
if (uid > 0) {
|
||||
f->uid = uid;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
void gamedb_update(void);
|
Loading…
Reference in New Issue