forked from github/server
store calendar configuration nin JSON, not XML.
This commit is contained in:
parent
ad465f1028
commit
7806f4991f
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"calendar" : {
|
||||||
|
"months" : [
|
||||||
|
{ "storm" : 60, "season" : 2 },
|
||||||
|
{ "storm" : 10, "season" : 2 },
|
||||||
|
|
||||||
|
{ "storm" : 60, "season" : 3 },
|
||||||
|
{ "storm" : 10, "season" : 3 },
|
||||||
|
|
||||||
|
{ "storm" : 60, "season" : 0 },
|
||||||
|
{ "storm" : 80, "season" : 0 },
|
||||||
|
|
||||||
|
{ "storm" : 50, "season" : 1 },
|
||||||
|
{ "storm" : 30, "season" : 1 },
|
||||||
|
{ "storm" : 60, "season" : 1 }
|
||||||
|
],
|
||||||
|
"weeks" : [
|
||||||
|
"firstweek", "secondweek", "thirdweek"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"include": [
|
"include": [
|
||||||
"keywords.json",
|
"keywords.json",
|
||||||
|
"calendar.json",
|
||||||
"prefixes.json",
|
"prefixes.json",
|
||||||
"e2/terrains.json"
|
"e2/terrains.json"
|
||||||
],
|
],
|
||||||
|
@ -22,6 +23,7 @@
|
||||||
"hunger.long": true,
|
"hunger.long": true,
|
||||||
"init_spells": 0,
|
"init_spells": 0,
|
||||||
"game.era": 2,
|
"game.era": 2,
|
||||||
|
"game.start": 184,
|
||||||
"rules.reserve.twophase": true,
|
"rules.reserve.twophase": true,
|
||||||
"rules.give.max_men": -1,
|
"rules.give.max_men": -1,
|
||||||
"rules.check_overload": false,
|
"rules.check_overload": false,
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
<xi:include href="config://game/artrewards.xml"/>
|
<xi:include href="config://game/artrewards.xml"/>
|
||||||
<xi:include href="config://game/buildings.xml"/>
|
<xi:include href="config://game/buildings.xml"/>
|
||||||
<xi:include href="config://core/calendar.xml"/>
|
<xi:include href="config://core/calendar.xml"/>
|
||||||
<calendar name="secondage" newyear="month_1" start="184"/>
|
|
||||||
<xi:include href="config://game/equipment.xml"/>
|
<xi:include href="config://game/equipment.xml"/>
|
||||||
<xi:include href="config://game/items.xml"/>
|
<xi:include href="config://game/items.xml"/>
|
||||||
<xi:include href="config://game/spells.xml"/>
|
<xi:include href="config://game/spells.xml"/>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"include": [
|
"include": [
|
||||||
"keywords.json",
|
"keywords.json",
|
||||||
|
"calendar.json",
|
||||||
"prefixes.json",
|
"prefixes.json",
|
||||||
"e3/terrains.json"
|
"e3/terrains.json"
|
||||||
],
|
],
|
||||||
|
@ -52,6 +53,7 @@
|
||||||
"study.expensivemigrants": true,
|
"study.expensivemigrants": true,
|
||||||
"study.speedup": 2,
|
"study.speedup": 2,
|
||||||
"game.era": 3,
|
"game.era": 3,
|
||||||
|
"game.start": 1,
|
||||||
"rules.reserve.twophase": true,
|
"rules.reserve.twophase": true,
|
||||||
"rules.owners.force_leave": false,
|
"rules.owners.force_leave": false,
|
||||||
"rules.wage.function": 2,
|
"rules.wage.function": 2,
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
<xi:include href="config://game/armor.xml" />
|
<xi:include href="config://game/armor.xml" />
|
||||||
<xi:include href="config://game/resources.xml" />
|
<xi:include href="config://game/resources.xml" />
|
||||||
|
|
||||||
<calendar name="thirdage" newyear="month_1" start="1"/>
|
|
||||||
|
|
||||||
<xi:include href="config://default/names-undead.xml"/>
|
<xi:include href="config://default/names-undead.xml"/>
|
||||||
<xi:include href="config://default/names-skeletons.xml"/>
|
<xi:include href="config://default/names-skeletons.xml"/>
|
||||||
<xi:include href="config://default/names-zombies.xml"/>
|
<xi:include href="config://default/names-zombies.xml"/>
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
<?xml version="1.0"?>
|
|
||||||
<calendar name="secondage" newyear="month_1">
|
|
||||||
<season name="winter">
|
|
||||||
<month name="month_4" storm="50" />
|
|
||||||
<month name="month_5" storm="30" />
|
|
||||||
<month name="month_6" storm="60" />
|
|
||||||
</season>
|
|
||||||
<season name="spring">
|
|
||||||
<month name="month_7" storm="60" />
|
|
||||||
<month name="month_8" storm="10" />
|
|
||||||
</season>
|
|
||||||
<season name="summer">
|
|
||||||
<month name="month_9" storm="60" />
|
|
||||||
<month name="month_1" storm="10" />
|
|
||||||
</season>
|
|
||||||
<season name="fall">
|
|
||||||
<month name="month_2" storm="60" />
|
|
||||||
<month name="month_3" storm="80" />
|
|
||||||
</season>
|
|
||||||
<week name="firstweek" />
|
|
||||||
<week name="secondweek" />
|
|
||||||
<week name="thirdweek" />
|
|
||||||
</calendar>
|
|
|
@ -6523,13 +6523,17 @@
|
||||||
<text locale="de">Sonnenfeuer</text>
|
<text locale="de">Sonnenfeuer</text>
|
||||||
<text locale="en">sunfire</text>
|
<text locale="en">sunfire</text>
|
||||||
</string>
|
</string>
|
||||||
<string name="secondage">
|
<string name="age_1">
|
||||||
|
<text locale="de">neuer Zeitrechnung</text>
|
||||||
|
<text locale="en">of the new age</text>
|
||||||
|
</string>
|
||||||
|
<string name="age_2">
|
||||||
<text locale="de">des zweiten Zeitalters</text>
|
<text locale="de">des zweiten Zeitalters</text>
|
||||||
<text locale="en">the second age</text>
|
<text locale="en">the second age</text>
|
||||||
</string>
|
</string>
|
||||||
<string name="newage">
|
<string name="age_3">
|
||||||
<text locale="de">neuer Zeitrechnung</text>
|
<text locale="de">des dritten Zeitalters</text>
|
||||||
<text locale="en">of the new age</text>
|
<text locale="en">the third age</text>
|
||||||
</string>
|
</string>
|
||||||
</namespace>
|
</namespace>
|
||||||
|
|
||||||
|
|
|
@ -38,12 +38,6 @@
|
||||||
<text locale="en">adamantium plates</text>
|
<text locale="en">adamantium plates</text>
|
||||||
</string>
|
</string>
|
||||||
|
|
||||||
<!--Fort-Ausbaustufen -->
|
|
||||||
<string name="calendar::thirdage">
|
|
||||||
<text locale="de">des dritten Zeitalters</text>
|
|
||||||
<text locale="en">the third age</text>
|
|
||||||
</string>
|
|
||||||
|
|
||||||
<string name="packice">
|
<string name="packice">
|
||||||
<text locale="de">Packeis</text>
|
<text locale="de">Packeis</text>
|
||||||
<text locale="en">fast ice</text>
|
<text locale="en">fast ice</text>
|
||||||
|
@ -87,6 +81,7 @@
|
||||||
<text locale="en">repeating crossbows</text>
|
<text locale="en">repeating crossbows</text>
|
||||||
</string>
|
</string>
|
||||||
|
|
||||||
|
<!--Fort-Ausbaustufen -->
|
||||||
<string name="scaffolding">
|
<string name="scaffolding">
|
||||||
<text locale="de">Gerüst</text>
|
<text locale="de">Gerüst</text>
|
||||||
<text locale="en">scaffolding</text>
|
<text locale="en">scaffolding</text>
|
||||||
|
@ -103,6 +98,7 @@
|
||||||
<text locale="de">Wache</text>
|
<text locale="de">Wache</text>
|
||||||
<text locale="en">watch</text>
|
<text locale="en">watch</text>
|
||||||
</string>
|
</string>
|
||||||
|
|
||||||
<string name="market">
|
<string name="market">
|
||||||
<text locale="de">Marktplatz</text>
|
<text locale="de">Marktplatz</text>
|
||||||
<text locale="en">marketplace</text>
|
<text locale="en">marketplace</text>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
local function is_winter(turn)
|
local function is_winter(turn)
|
||||||
local season = get_season(turn)
|
local season = get_season(turn)
|
||||||
return season == "calendar::winter"
|
return season == "winter"
|
||||||
end
|
end
|
||||||
|
|
||||||
local function is_spring(turn)
|
local function is_spring(turn)
|
||||||
local season = get_season(turn)
|
local season = get_season(turn)
|
||||||
return season == "calendar::spring"
|
return season == "spring"
|
||||||
end
|
end
|
||||||
|
|
||||||
local function freeze(r, chance)
|
local function freeze(r, chance)
|
||||||
|
|
|
@ -87,7 +87,7 @@ local self = {}
|
||||||
function self.update()
|
function self.update()
|
||||||
local turn = get_turn()
|
local turn = get_turn()
|
||||||
local season = get_season(turn)
|
local season = get_season(turn)
|
||||||
if season == "calendar::winter" then
|
if season == "winter" then
|
||||||
eressea.log.debug("it is " .. season .. ", the christmas trees do their magic")
|
eressea.log.debug("it is " .. season .. ", the christmas trees do their magic")
|
||||||
local msg = message.create("xmastree_effect")
|
local msg = message.create("xmastree_effect")
|
||||||
for r in regions() do
|
for r in regions() do
|
||||||
|
@ -103,7 +103,7 @@ function self.update()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
local prevseason = get_season(turn-1)
|
local prevseason = get_season(turn-1)
|
||||||
if prevseason == "calendar::winter" then
|
if prevseason == "winter" then
|
||||||
-- we celebrate knut and kick out the trees.
|
-- we celebrate knut and kick out the trees.
|
||||||
for r in regions() do
|
for r in regions() do
|
||||||
if r:get_key("xm06") then
|
if r:get_key("xm06") then
|
||||||
|
|
|
@ -11,8 +11,8 @@ function setup()
|
||||||
end
|
end
|
||||||
|
|
||||||
function test_calendar()
|
function test_calendar()
|
||||||
assert_equal(get_season(1011), "calendar::winter")
|
assert_equal("winter", get_season(1011))
|
||||||
assert_equal(get_season(1012), "calendar::spring")
|
assert_equal("spring", get_season(1012))
|
||||||
end
|
end
|
||||||
|
|
||||||
function test_herbalism()
|
function test_herbalism()
|
||||||
|
|
|
@ -38,7 +38,7 @@ function teardown()
|
||||||
end
|
end
|
||||||
|
|
||||||
function test_calendar()
|
function test_calendar()
|
||||||
assert_equal(get_season(396), "calendar::winter")
|
assert_equal("winter", get_season(396))
|
||||||
end
|
end
|
||||||
|
|
||||||
function disable_test_bug_1738_build_castle_e3()
|
function disable_test_bug_1738_build_castle_e3()
|
||||||
|
|
|
@ -1,20 +1,35 @@
|
||||||
#include <platform.h>
|
#include <platform.h>
|
||||||
#include "calendar.h"
|
#include "calendar.h"
|
||||||
|
#include "move.h" /* storms */
|
||||||
|
|
||||||
#include <kernel/config.h>
|
#include <kernel/config.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
int first_month = 0;
|
int first_month = 0;
|
||||||
int weeks_per_month = 3;
|
int weeks_per_month = 3;
|
||||||
int months_per_year = 12;
|
int months_per_year = 12;
|
||||||
char **seasonnames = NULL;
|
const char *seasonnames[CALENDAR_SEASONS] = { "winter", "spring", "summer", "fall" };
|
||||||
char **weeknames = NULL;
|
char **weeknames = NULL;
|
||||||
char **weeknames2 = NULL;
|
char **weeknames2 = NULL;
|
||||||
char **monthnames = NULL;
|
|
||||||
int *month_season = NULL;
|
int *month_season = NULL;
|
||||||
char *agename = NULL;
|
|
||||||
int seasons = 0;
|
const char *calendar_month(int index)
|
||||||
|
{
|
||||||
|
static char result[20];
|
||||||
|
snprintf(result, sizeof(result), "month_%d", index + 1);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *calendar_era(void)
|
||||||
|
{
|
||||||
|
static char result[20];
|
||||||
|
int era = config_get_int("game.era", 1);
|
||||||
|
snprintf(result, sizeof(result), "age_%d", era);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
int first_turn(void)
|
int first_turn(void)
|
||||||
{
|
{
|
||||||
|
@ -40,34 +55,17 @@ void calendar_cleanup(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
free(agename);
|
|
||||||
|
|
||||||
if (seasonnames) {
|
|
||||||
for (i = 0; i != seasons; ++i) {
|
|
||||||
free(seasonnames[i]);
|
|
||||||
}
|
|
||||||
free(seasonnames);
|
|
||||||
seasonnames = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (monthnames) {
|
|
||||||
for (i = 0; i != months_per_year; ++i) {
|
|
||||||
free(monthnames[i]);
|
|
||||||
}
|
|
||||||
free(storms);
|
|
||||||
storms = 0;
|
|
||||||
free(month_season);
|
|
||||||
month_season = 0;
|
|
||||||
free(monthnames);
|
|
||||||
monthnames = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i != weeks_per_month; ++i) {
|
for (i = 0; i != weeks_per_month; ++i) {
|
||||||
if (weeknames)
|
if (weeknames)
|
||||||
free(weeknames[i]);
|
free(weeknames[i]);
|
||||||
if (weeknames2)
|
if (weeknames2)
|
||||||
free(weeknames2[i]);
|
free(weeknames2[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(storms);
|
||||||
|
storms = 0;
|
||||||
|
free(month_season);
|
||||||
|
month_season = 0;
|
||||||
free(weeknames);
|
free(weeknames);
|
||||||
weeknames = 0;
|
weeknames = 0;
|
||||||
free(weeknames2);
|
free(weeknames2);
|
||||||
|
|
|
@ -11,17 +11,12 @@ extern "C" {
|
||||||
SEASON_SUMMER,
|
SEASON_SUMMER,
|
||||||
SEASON_AUTUMN
|
SEASON_AUTUMN
|
||||||
};
|
};
|
||||||
|
#define CALENDAR_SEASONS 4
|
||||||
extern char *agename;
|
extern const char *seasonnames[CALENDAR_SEASONS];
|
||||||
extern int first_month;
|
|
||||||
|
|
||||||
extern int seasons;
|
|
||||||
extern char **seasonnames;
|
|
||||||
|
|
||||||
extern int months_per_year;
|
extern int months_per_year;
|
||||||
extern char **monthnames;
|
|
||||||
extern int *month_season;
|
extern int *month_season;
|
||||||
extern int *storms; /* in movement.c */
|
extern int first_month;
|
||||||
|
|
||||||
extern char **weeknames;
|
extern char **weeknames;
|
||||||
extern char **weeknames2;
|
extern char **weeknames2;
|
||||||
|
@ -36,6 +31,8 @@ extern "C" {
|
||||||
|
|
||||||
const gamedate *get_gamedate(int turn, gamedate * gd);
|
const gamedate *get_gamedate(int turn, gamedate * gd);
|
||||||
void calendar_cleanup(void);
|
void calendar_cleanup(void);
|
||||||
|
const char *calendar_month(int index);
|
||||||
|
const char *calendar_era(void);
|
||||||
int first_turn(void);
|
int first_turn(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -33,6 +33,8 @@ without prior permission by the authors of Eressea.
|
||||||
|
|
||||||
/* game modules */
|
/* game modules */
|
||||||
#include "prefix.h"
|
#include "prefix.h"
|
||||||
|
#include "move.h"
|
||||||
|
#include "calendar.h"
|
||||||
|
|
||||||
/* util includes */
|
/* util includes */
|
||||||
#include <util/attrib.h>
|
#include <util/attrib.h>
|
||||||
|
@ -684,6 +686,74 @@ static void json_direction(cJSON *json, struct locale *lang) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void json_calendar(cJSON *json) {
|
||||||
|
cJSON *child;
|
||||||
|
if (json->type != cJSON_Object) {
|
||||||
|
log_error("calendar is not an object: %d", json->type);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (child = json->child; child; child = child->next) {
|
||||||
|
if (strcmp(child->string, "start") == 0) {
|
||||||
|
config_set_int("game.start", child->valueint);
|
||||||
|
}
|
||||||
|
else if (strcmp(child->string, "weeks") == 0) {
|
||||||
|
cJSON *entry;
|
||||||
|
int i;
|
||||||
|
if (child->type != cJSON_Array) {
|
||||||
|
log_error("calendar.weeks is not an array: %d", json->type);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
weeks_per_month = cJSON_GetArraySize(child);
|
||||||
|
free(weeknames);
|
||||||
|
weeknames = malloc(sizeof(char *) * weeks_per_month);
|
||||||
|
for (i = 0, entry = child->child; entry; entry = entry->next, ++i) {
|
||||||
|
if (entry->type == cJSON_String) {
|
||||||
|
weeknames[i] = strdup(entry->valuestring);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
log_error("calendar.weeks[%d] is not a string: %d", i, json->type);
|
||||||
|
free(weeknames);
|
||||||
|
weeknames = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assert(i == weeks_per_month);
|
||||||
|
free(weeknames2);
|
||||||
|
weeknames2 = malloc(sizeof(char *) * weeks_per_month);
|
||||||
|
for (i = 0; i != weeks_per_month; ++i) {
|
||||||
|
weeknames2[i] = malloc(strlen(weeknames[i]) + 3);
|
||||||
|
sprintf(weeknames2[i], "%s_d", weeknames[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (strcmp(child->string, "months") == 0) {
|
||||||
|
cJSON *jmonth;
|
||||||
|
int i;
|
||||||
|
if (child->type != cJSON_Array) {
|
||||||
|
log_error("calendar.seasons is not an array: %d", json->type);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
free(month_season);
|
||||||
|
month_season = NULL;
|
||||||
|
free(storms);
|
||||||
|
months_per_year = cJSON_GetArraySize(child);
|
||||||
|
storms = malloc(sizeof(int) * months_per_year);
|
||||||
|
month_season = malloc(sizeof(int) * months_per_year);
|
||||||
|
for (i = 0, jmonth = child->child; jmonth; jmonth = jmonth->next, ++i) {
|
||||||
|
if (jmonth->type == cJSON_Object) {
|
||||||
|
storms[i] = cJSON_GetObjectItem(jmonth, "storm")->valueint;
|
||||||
|
month_season[i] = cJSON_GetObjectItem(jmonth, "season")->valueint;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
log_error("calendar.months[%d] is not an object: %d", i, json->type);
|
||||||
|
free(storms);
|
||||||
|
storms = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void json_directions(cJSON *json) {
|
static void json_directions(cJSON *json) {
|
||||||
cJSON *child;
|
cJSON *child;
|
||||||
if (json->type != cJSON_Object) {
|
if (json->type != cJSON_Object) {
|
||||||
|
@ -890,6 +960,9 @@ void json_config(cJSON *json) {
|
||||||
else if (strcmp(child->string, "strings") == 0) {
|
else if (strcmp(child->string, "strings") == 0) {
|
||||||
json_strings(child);
|
json_strings(child);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(child->string, "calendar") == 0) {
|
||||||
|
json_calendar(child);
|
||||||
|
}
|
||||||
else if (strcmp(child->string, "directions") == 0) {
|
else if (strcmp(child->string, "directions") == 0) {
|
||||||
json_directions(child);
|
json_directions(child);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ without prior permission by the authors of Eressea.
|
||||||
#include "spellbook.h"
|
#include "spellbook.h"
|
||||||
#include "calendar.h"
|
#include "calendar.h"
|
||||||
#include "prefix.h"
|
#include "prefix.h"
|
||||||
|
#include "move.h"
|
||||||
|
|
||||||
#include "vortex.h"
|
#include "vortex.h"
|
||||||
|
|
||||||
|
@ -398,6 +399,7 @@ static int parse_buildings(xmlDocPtr doc)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static int parse_calendar(xmlDocPtr doc)
|
static int parse_calendar(xmlDocPtr doc)
|
||||||
{
|
{
|
||||||
xmlXPathContextPtr xpath = xmlXPathNewContext(doc);
|
xmlXPathContextPtr xpath = xmlXPathNewContext(doc);
|
||||||
|
@ -523,7 +525,7 @@ static int parse_calendar(xmlDocPtr doc)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
static int parse_ships(xmlDocPtr doc)
|
static int parse_ships(xmlDocPtr doc)
|
||||||
{
|
{
|
||||||
xmlXPathContextPtr xpath = xmlXPathNewContext(doc);
|
xmlXPathContextPtr xpath = xmlXPathNewContext(doc);
|
||||||
|
@ -1869,7 +1871,6 @@ static int parse_strings(xmlDocPtr doc)
|
||||||
void register_xmlreader(void)
|
void register_xmlreader(void)
|
||||||
{
|
{
|
||||||
xml_register_callback(parse_races);
|
xml_register_callback(parse_races);
|
||||||
xml_register_callback(parse_calendar);
|
|
||||||
xml_register_callback(parse_resources);
|
xml_register_callback(parse_resources);
|
||||||
|
|
||||||
xml_register_callback(parse_buildings); /* requires resources */
|
xml_register_callback(parse_buildings); /* requires resources */
|
||||||
|
|
|
@ -34,6 +34,7 @@ extern "C" {
|
||||||
struct order;
|
struct order;
|
||||||
|
|
||||||
extern struct attrib_type at_shiptrail;
|
extern struct attrib_type at_shiptrail;
|
||||||
|
extern int *storms;
|
||||||
|
|
||||||
/* die Zahlen sind genau äquivalent zu den race Flags */
|
/* die Zahlen sind genau äquivalent zu den race Flags */
|
||||||
#define MV_CANNOTMOVE (1<<5)
|
#define MV_CANNOTMOVE (1<<5)
|
||||||
|
|
|
@ -123,13 +123,15 @@ static char *gamedate_season(const struct locale *lang)
|
||||||
static char buf[256]; /* FIXME: static return value */
|
static char buf[256]; /* FIXME: static return value */
|
||||||
gamedate gd;
|
gamedate gd;
|
||||||
|
|
||||||
|
assert(weeknames);
|
||||||
|
|
||||||
get_gamedate(turn, &gd);
|
get_gamedate(turn, &gd);
|
||||||
|
|
||||||
sprintf(buf, (const char *)LOC(lang, "nr_calendar_season"),
|
sprintf(buf, (const char *)LOC(lang, "nr_calendar_season"),
|
||||||
LOC(lang, weeknames[gd.week]),
|
LOC(lang, mkname("calendar", weeknames[gd.week])),
|
||||||
LOC(lang, monthnames[gd.month]),
|
LOC(lang, mkname("calendar", calendar_month(gd.month))),
|
||||||
gd.year,
|
gd.year,
|
||||||
agename ? LOC(lang, agename) : "", LOC(lang, seasonnames[gd.season]));
|
LOC(lang, mkname("calendar", calendar_era())), LOC(lang, mkname("calendar", seasonnames[gd.season])));
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,13 +151,12 @@ static char *gamedate2(const struct locale *lang)
|
||||||
if (weeknames2) {
|
if (weeknames2) {
|
||||||
week = weeknames2[gd.week];
|
week = weeknames2[gd.week];
|
||||||
}
|
}
|
||||||
if (monthnames) {
|
month = calendar_month(gd.month);
|
||||||
month = monthnames[gd.month];
|
|
||||||
}
|
|
||||||
sprintf(buf, "in %s des Monats %s im Jahre %d %s.",
|
sprintf(buf, "in %s des Monats %s im Jahre %d %s.",
|
||||||
LOC(lang, week),
|
LOC(lang, mkname("calendar", week)),
|
||||||
LOC(lang, month),
|
LOC(lang, mkname("calendar", month)),
|
||||||
gd.year, agename ? LOC(lang, agename) : "");
|
gd.year,
|
||||||
|
LOC(lang, mkname("calendar", calendar_era())));
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue