Use the new Empire clock for generating BTUs:

(natstr): New member nat_access.
(cou_ca): New selector access.
(grant_btus, accrued_btus): New.
(prod_nat, init_nat): Use grant_btus().  BTUs are now made at the
update in addition to login, because that lets us get away with a
simple ETU stamp (nat_access).
(nat_cap): Replaced by grant_btus(), remove.
This commit is contained in:
Markus Armbruster 2007-07-14 16:30:12 +00:00
parent dd2daaaab3
commit d3e0597f0e
5 changed files with 107 additions and 47 deletions

View file

@ -95,6 +95,7 @@ struct natstr {
unsigned short nat_ann; /* # of annos pending */
unsigned short nat_minused; /* number of minutes used today */
short nat_btu; /* bureaucratic time units */
short nat_access; /* The tick when BTUs were last updated */
long nat_reserve; /* military reserves */
long nat_money; /* moola */
time_t nat_last_login; /* time of last login, 0 menas never */
@ -178,6 +179,8 @@ extern void putcontact(struct natstr *np, natid them, int contact);
extern void agecontact(struct natstr *np);
extern int influx(struct natstr *np);
extern int grant_btus(struct natstr *, int );
/* nation flags */
#define NF_INFORM bit(0) /* Inform me of telegrams right away */
#define NF_FLASH bit(1) /* Allow other players to flash me (sicko :) */