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
|
@ -34,6 +34,7 @@
|
|||
#include <config.h>
|
||||
|
||||
#include "commands.h"
|
||||
#include "game.h"
|
||||
#include "item.h"
|
||||
#include "map.h"
|
||||
#include "optlist.h"
|
||||
|
@ -251,7 +252,7 @@ explore(void)
|
|||
pr("Sector %s is now yours.\n",
|
||||
xyas(sect.sct_x, sect.sct_y, player->cnum));
|
||||
if (opt_MOB_ACCESS) {
|
||||
time(§.sct_access);
|
||||
game_tick_to_now(§.sct_access);
|
||||
sect.sct_mobil = -(etu_per_update / sect_mob_neg_factor);
|
||||
} else {
|
||||
sect.sct_mobil = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue