New Empire table game, to be used for global stuff:
(gamestr, EF_GAME, game_ca): New. (empfile): Declare the table. (ef_open_srv, ef_close_srv): Open and close it. (main): Create it. (empobj_storage): New member game. (EF_DYNMAX): New. (EF_IS_GAME_STATE): Use it.
This commit is contained in:
parent
4ba4cd98c6
commit
654335c621
9 changed files with 68 additions and 1 deletions
|
@ -36,6 +36,7 @@
|
|||
#include <stddef.h>
|
||||
#include "commodity.h"
|
||||
#include "file.h"
|
||||
#include "game.h"
|
||||
#include "land.h"
|
||||
#include "loan.h"
|
||||
#include "lost.h"
|
||||
|
@ -139,6 +140,8 @@ struct empfile empfile[] = {
|
|||
UNMAPPED_CACHE(struct loststr, EFF_OWNER)},
|
||||
{EF_REALM, "realm", "realms", realm_ca,
|
||||
UNMAPPED_CACHE(struct realmstr, EFF_OWNER)},
|
||||
{EF_GAME, "game", "game", game_ca,
|
||||
UNMAPPED_CACHE(struct gamestr, 0)},
|
||||
|
||||
/* Static game data (configuration) */
|
||||
{EF_ITEM, "item", "item.config", ichr_ca,
|
||||
|
|
|
@ -544,6 +544,10 @@ struct castr realm_ca[] = {
|
|||
{NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
|
||||
};
|
||||
|
||||
struct castr game_ca[] = {
|
||||
{NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
|
||||
};
|
||||
|
||||
struct castr intrchr_ca[] = {
|
||||
/* no need for uid as long as it's not referenced from other tables */
|
||||
{NSC_STRING, NSC_CONST, 0, offsetof(struct sctintrins, in_name), "name",
|
||||
|
|
|
@ -104,6 +104,7 @@ ef_open_srv(void)
|
|||
failed |= !ef_open(EF_SHIP, EFF_MEM);
|
||||
failed |= !ef_open(EF_PLANE, EFF_MEM);
|
||||
failed |= !ef_open(EF_LAND, EFF_MEM);
|
||||
failed |= !ef_open(EF_GAME, EFF_MEM);
|
||||
failed |= !ef_open(EF_NEWS, 0);
|
||||
failed |= !ef_open(EF_LOAN, 0);
|
||||
failed |= !ef_open(EF_TREATY, 0);
|
||||
|
@ -132,6 +133,7 @@ ef_close_srv(void)
|
|||
ef_close(EF_SHIP);
|
||||
ef_close(EF_PLANE);
|
||||
ef_close(EF_LAND);
|
||||
ef_close(EF_GAME);
|
||||
ef_close(EF_NEWS);
|
||||
ef_close(EF_LOAN);
|
||||
ef_close(EF_TREATY);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue