Prevent command from executing outside of game hours

If a player is at a prompt when game hours restrictions start,
they can enter one more command.  Not fixed in commit 3da4030a,
v4.3.19.
This commit is contained in:
Ron Koenderink 2009-01-24 10:25:57 -06:00
parent a3c991bcce
commit a499a5d8f2

View file

@ -137,6 +137,11 @@ command(void)
now = time(NULL); now = time(NULL);
update_timeused(now); update_timeused(now);
natp = getnatp(player->cnum); natp = getnatp(player->cnum);
if (!gamehours(player->curup))
if (natp->nat_stat != STAT_GOD) {
pr("Empire hours restriction in force\n");
return 0;
}
if ((natp->nat_stat == STAT_ACTIVE || natp->nat_stat == STAT_SANCT) if ((natp->nat_stat == STAT_ACTIVE || natp->nat_stat == STAT_SANCT)
&& natp->nat_timeused > m_m_p_d * 60) { && natp->nat_timeused > m_m_p_d * 60) {
pr("Max minutes per day limit exceeded.\n"); pr("Max minutes per day limit exceeded.\n");