subs: Simplify MOB_ACCESS mobility update
The do_upd_checking recursion guard is superfluous: do_mob_sect() doesn't call anything. Has been that way since MOB_ACCESS was added in Empire 3. Inline the remaining code of sct_do_upd_mob(), shp_do_upd_mob(), pln_do_upd_mob(), lnd_do_upd_mob() in their only callers sct_postread(), shp_postread(), pln_postread(), lnd_postread(). Rename do_mob_sect(), do_mob_ship(), do_mob_plane(), do_mob_land() to mob_sect, mob_ship(), mob_plane(), mob_land() and give them external linkage. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
25d48124d0
commit
dd9e393b38
6 changed files with 46 additions and 113 deletions
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include <ctype.h>
|
||||
#include "file.h"
|
||||
#include "game.h"
|
||||
#include "lost.h"
|
||||
#include "misc.h"
|
||||
#include "nsc.h"
|
||||
|
@ -43,6 +44,7 @@
|
|||
#include "player.h"
|
||||
#include "prototypes.h"
|
||||
#include "sect.h"
|
||||
#include "server.h"
|
||||
#include "update.h"
|
||||
#include "xy.h"
|
||||
|
||||
|
@ -52,8 +54,10 @@ sct_postread(int id, void *ptr)
|
|||
struct sctstr *sp = ptr;
|
||||
|
||||
player->owner = (player->god || sp->sct_own == player->cnum);
|
||||
if (opt_MOB_ACCESS)
|
||||
sct_do_upd_mob(sp);
|
||||
|
||||
if (opt_MOB_ACCESS && sp->sct_own && sp->sct_type != SCT_SANCT
|
||||
&& !update_running)
|
||||
mob_inc_sect(sp, game_tick_to_now(&sp->sct_access));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue