fix off-by-one calendar, bug 2288

This commit is contained in:
Enno Rehling 2017-03-01 08:28:15 +01:00
parent 17d410345f
commit e2e602e7ba
3 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<calendar name="secondage" newyear="month_1" start="0"> <calendar name="secondage" newyear="month_1">
<season name="winter"> <season name="winter">
<month name="month_4" storm="50" /> <month name="month_4" storm="50" />
<month name="month_5" storm="30" /> <month name="month_5" storm="30" />

View File

@ -10,6 +10,11 @@ function setup()
eressea.settings.set("rules.encounters", "0") eressea.settings.set("rules.encounters", "0")
end end
function test_calendar()
assert_equal(get_season(1011), "calendar::winter")
assert_equal(get_season(1012), "calendar::spring")
end
function test_herbalism() function test_herbalism()
-- OBS: herbalism is currently an E2-only skill -- OBS: herbalism is currently an E2-only skill
local r = region.create(0, 0, "plain") local r = region.create(0, 0, "plain")

View File

@ -18,7 +18,7 @@ int seasons = 0;
int first_turn(void) int first_turn(void)
{ {
return config_get_int("game.start", 1); return config_get_int("game.start", 0);
} }
const gamedate *get_gamedate(int turn, gamedate * gd) const gamedate *get_gamedate(int turn, gamedate * gd)