Use the new Empire clock for implementing MOB_ACCESS:
(lndstr, plnstr, sctstr, shpstr): Change timestamp members lnd_access, pln_access, sct_access, shp_access from real time (time_t) to ETUs within a turn (short). (land_ca, plane_ca, sect_ca, ship_ca): Update accordingly. (build_ship, build_land, build_bridge, build_plane, build_tower) (explore, check_trade, bsanct, takeover, takeover_ship) (takeover_land): Use game_tick_to_now() instead of time() to update the timestamp. Change check_trade(), takeover_ship(), takeover_land() to do that only when MOB_ACCESS is enabled, for consistency. (lupgr, supgr, pupgr, takeover_ship): Don't touch the timestamp where mobility isn't touched either. (sct_do_upd_mob, shp_do_upd_mob, lnd_do_upd_mob, pln_do_upd_mob): Use game_tick_to_now() instead of increase_mob() to compute ETUs since the timestamp and update the timestamp. Closes #1012699. (increase_mob): Remove. (mob_sect, mob_ship, mob_land, mob_plane): sct_do_upd_mob() & friends no longer do the right thing at the update. Use game_reset_tick() and pass its result directly to do_mob_sect() & friends. This is only correct when argument is etu_per_update, which it always is. Remove parameter. Callers changed. (do_mob_sect, do_mob_ship, do_mob_land, do_mob_plane): Oops on negative argument. (mob_acc_globals, timestampfil, mobupdate, updating_mob) (update_all_mob, timestamp_fixing, update_timestamps, mobility_check): The mobupdate command was important to let deities manually synchronize mobility updating with updates. That's no longer needed. The code behind it is somewhat hairy and ugly, and updating it to work with the Empire clock is just not worth it. Remove. Users changed. (player_coms): Update accordingly. (upda): Remove display of mobility updating state. (mobility_init): No need to fix up mobility on startup, as the Empire clock runs normally even when the server is down. Remove. Caller changed.
This commit is contained in:
parent
aa34ef2b7b
commit
4bd19812af
25 changed files with 92 additions and 458 deletions
|
@ -161,7 +161,6 @@ int mark(void);
|
|||
int mine(void);
|
||||
int mission(void);
|
||||
int mobq(void);
|
||||
int mobupdate(void);
|
||||
int morale(void);
|
||||
int move(void);
|
||||
int multifire(void);
|
||||
|
@ -736,12 +735,10 @@ extern int prod_land(int, int, struct bp *, int);
|
|||
/* material.c */
|
||||
/* in budg.h */
|
||||
/* mobility.c */
|
||||
extern void mob_sect(int);
|
||||
extern void mob_ship(int);
|
||||
extern void mob_land(int);
|
||||
extern void mob_plane(int);
|
||||
extern void update_all_mob(void);
|
||||
extern void update_timestamps(time_t offset);
|
||||
extern void mob_sect(void);
|
||||
extern void mob_ship(void);
|
||||
extern void mob_land(void);
|
||||
extern void mob_plane(void);
|
||||
extern void sct_do_upd_mob(struct sctstr *sp);
|
||||
extern void shp_do_upd_mob(struct shpstr *sp);
|
||||
extern void lnd_do_upd_mob(struct lndstr *lp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue