parameter. Remove calls without effect. Other callers changed.
/* hap_fact.c */
extern double hap_fact(struct natstr *, struct natstr *);
/* hours.c */
-extern int gamehours(time_t, int *);
+extern int gamehours(time_t);
/* land.c */
extern int has_units(coord, coord, natid, struct lndstr *);
extern int has_units_with_mob(coord, coord, natid);
/*
* returns true if game can be played now.
- * Sets the number of minutes until the hours
- * function must be re-called.
*/
int
-gamehours(time_t now, int *hour)
+gamehours(time_t now)
{
register s_char *bp;
register struct tm *tm;
int day;
int curtime;
int okday[7];
- int tomorrow;
+ int hour[2];
tm = localtime(&now);
curtime = tm->tm_min + tm->tm_hour * 60;
break;
if (bp == 0)
return 0;
- } else {
- hour[0] = 0;
- hour[1] = 24 * 60;
}
- tomorrow = tm->tm_wday + 1;
- if (tomorrow >= 7)
- tomorrow = 0;
return 1;
}
player_main(struct player *p)
{
struct natstr *natp;
- int hour[2];
int secs;
s_char buf[128];
pr("You're not a deity!\n");
return;
}
- if (!gamehours(player->curup, hour)) {
+ if (!gamehours(player->curup)) {
pr("Empire hours restriction in force\n");
if ((natp->nat_stat & STAT_GOD) == 0)
return;
struct natstr *natp;
int minute;
struct sctstr sect;
- int hour[2];
s_char buf[128];
if (player->state == PS_SHUTDOWN)
* either day change, or hours restriction
*/
daychange(player->curup);
- if (!gamehours(player->curup, hour)) {
+ if (!gamehours(player->curup)) {
pr("Empire hours restriction in force\n");
if ((natp->nat_stat & STAT_GOD) == 0) {
putnat(natp);
main(int argc, char **argv)
{
time_t now;
- int hour[2];
int flags = 0;
int op;
char *config_file = NULL;
ef_init();
init_files();
io_init();
- gamehours(now, hour);
if (opt_MOB_ACCESS) {
/* This fixes up mobility upon restart */
struct mob_acc_globals timestamps;
time_t now;
FILE *fp;
- int hour[2];
while (1) {
time(&now);
rewind(fp);
fwrite(×tamps, sizeof(timestamps), 1, fp);
fclose(fp);
- if (!gamehours(now, hour)) {
+ if (!gamehours(now)) {
if (updating_mob == 1) {
update_all_mob();
logerror("Turning off mobility updating (gamehours).");
time(&now);
logerror("Done at %s", ctime(&now));
- if (now >= timestamps.starttime && gamehours(now, hour)) {
+ if (now >= timestamps.starttime && gamehours(now)) {
logerror("Turning on mobility updating.");
updating_mob = 1;
} else {
update_sched(void *unused)
{
s_char *kw;
- int hour[2];
int wind;
time_t now, delta;
empth_create(PP_SCHED, update_wait, (50 * 1024), 0, "UpdateWait",
"Waits until players idle", 0);
time(&now);
- (void)gamehours(now, hour);
if (s_p_etu <= 0) {
logerror("bad value for s_p_etu (%d)", s_p_etu);
s_p_etu = 2 * 60;
empth_sleep(update_time);
time(&now);
now += adj_update;
- if (!gamehours(now, hour)) {
+ if (!gamehours(now)) {
logerror("No update permitted (hours restriction)");
continue;
}