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
|
@ -93,7 +93,7 @@ struct shpstr {
|
|||
short shp_item[I_MAX+1]; /* amount of items on board */
|
||||
short shp_pstage; /* plague stage */
|
||||
short shp_ptime; /* how many etus remain in this stage */
|
||||
time_t shp_access; /* Last time mob was updated (MOB_ACCESS) */
|
||||
short shp_access; /* Last tick mob was updated (MOB_ACCESS) */
|
||||
time_t shp_timestamp; /* Last time this ship was touched. */
|
||||
unsigned char shp_mobquota; /* mobility quota */
|
||||
char shp_path[MAXSHPPATH];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue