Move pln_oninit(), lnd_oninit(), nuk_oninit() to filetable.c
They set up invariants, and thus should be always active, not just in the server. Since ef_blank() isn't used for these files outside the server right now, this isn't a bug fix, just cleanup.
This commit is contained in:
parent
3fe3cd376f
commit
31b9ff08f3
6 changed files with 35 additions and 37 deletions
|
@ -40,18 +40,17 @@
|
|||
|
||||
struct fileinit {
|
||||
int ef_type;
|
||||
void (*oninit)(void *);
|
||||
void (*postread)(int, void *);
|
||||
void (*prewrite)(int, void *, void *);
|
||||
void (*onresize)(int);
|
||||
};
|
||||
|
||||
static struct fileinit fileinit[] = {
|
||||
{EF_SECTOR, NULL, sct_postread, sct_prewrite, NULL},
|
||||
{EF_SHIP, NULL, shp_postread, shp_prewrite, unit_onresize},
|
||||
{EF_PLANE, pln_oninit, pln_postread, pln_prewrite, unit_onresize},
|
||||
{EF_LAND, lnd_oninit, lnd_postread, lnd_prewrite, unit_onresize},
|
||||
{EF_NUKE, nuk_oninit, nuk_postread, nuk_prewrite, unit_onresize}
|
||||
{EF_SECTOR, sct_postread, sct_prewrite, NULL},
|
||||
{EF_SHIP, shp_postread, shp_prewrite, unit_onresize},
|
||||
{EF_PLANE, pln_postread, pln_prewrite, unit_onresize},
|
||||
{EF_LAND, lnd_postread, lnd_prewrite, unit_onresize},
|
||||
{EF_NUKE, nuk_postread, nuk_prewrite, unit_onresize}
|
||||
};
|
||||
|
||||
static void ef_open_srv(void);
|
||||
|
@ -66,7 +65,6 @@ ef_init_srv(void)
|
|||
unsigned i;
|
||||
|
||||
for (i = 0; i < sizeof(fileinit) / sizeof(fileinit[0]); i++) {
|
||||
empfile[fileinit[i].ef_type].oninit = fileinit[i].oninit;
|
||||
empfile[fileinit[i].ef_type].postread = fileinit[i].postread;
|
||||
empfile[fileinit[i].ef_type].prewrite = fileinit[i].prewrite;
|
||||
empfile[fileinit[i].ef_type].onresize = fileinit[i].onresize;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue