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
|
@ -28,7 +28,7 @@
|
|||
*
|
||||
* Known contributors to this file:
|
||||
* Steve McClure, 1996
|
||||
* Markus Armbruster, 2004-2011
|
||||
* Markus Armbruster, 2004-2016
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
@ -40,6 +40,7 @@
|
|||
#include "optlist.h"
|
||||
#include "player.h"
|
||||
#include "prototypes.h"
|
||||
#include "server.h"
|
||||
#include "unit.h"
|
||||
#include "update.h"
|
||||
|
||||
|
@ -54,9 +55,10 @@ lnd_postread(int n, void *ptr)
|
|||
memset(lp, 0, sizeof(struct lndstr));
|
||||
}
|
||||
|
||||
if (opt_MOB_ACCESS)
|
||||
lnd_do_upd_mob(lp);
|
||||
player->owner = (player->god || lp->lnd_own == player->cnum);
|
||||
|
||||
if (opt_MOB_ACCESS && lp->lnd_own && !update_running)
|
||||
mob_inc_land(lp, game_tick_to_now(&lp->lnd_access));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue