From b3db14465e014b5124993cf2c53d2647b297212b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 1 Feb 2016 13:59:35 +0100 Subject: [PATCH 1/2] fix logic error in json_buildings --- src/kernel/jsonconf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/kernel/jsonconf.c b/src/kernel/jsonconf.c index fc2d9dd20..099b7a228 100644 --- a/src/kernel/jsonconf.c +++ b/src/kernel/jsonconf.c @@ -114,7 +114,7 @@ static void json_maintenance_i(cJSON *json, maintenance *mt) { } break; default: - log_error("maintenance contains unknown attribute %s", child->string); + log_error("maintenance contains unknown attribute %s of type %d", child->string, child->type); } } } @@ -139,7 +139,9 @@ static void json_maintenance(cJSON *json, maintenance **mtp) { } } } - json_maintenance_i(json, mt); + else { + json_maintenance_i(json, mt); + } } static void json_construction(cJSON *json, construction **consp) { From 23e57c6bff654c3362458279cd48c7b8f32b012f Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 1 Feb 2016 14:06:56 +0100 Subject: [PATCH 2/2] fix missing translation error messages during tests. --- src/reports.test.c | 7 ++++--- src/tests.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/reports.test.c b/src/reports.test.c index 103dc28ff..dd2c544eb 100644 --- a/src/reports.test.c +++ b/src/reports.test.c @@ -262,6 +262,7 @@ static void test_write_unit(CuTest *tc) { locale_setstring(lang, "nr_skills", "Talente"); locale_setstring(lang, "skill::sailing", "Segeln"); locale_setstring(lang, "skill::alchemy", "Alchemie"); + locale_setstring(lang, "status_aggressive", "aggressiv"); init_skills(lang); u = test_create_unit(test_create_faction(rc), test_create_region(0, 0, 0)); u->faction->locale = lang; @@ -271,15 +272,15 @@ static void test_write_unit(CuTest *tc) { unit_setid(u, 1); bufunit(u->faction, u, 0, 0, buffer, sizeof(buffer)); - CuAssertStrEquals(tc, "Hodor (1), 1 human, status_aggressive.", buffer); + CuAssertStrEquals(tc, "Hodor (1), 1 human, aggressiv.", buffer); set_level(u, SK_SAILING, 1); bufunit(u->faction, u, 0, 0, buffer, sizeof(buffer)); - CuAssertStrEquals(tc, "Hodor (1), 1 human, status_aggressive, Talente: Segeln 1.", buffer); + CuAssertStrEquals(tc, "Hodor (1), 1 human, aggressiv, Talente: Segeln 1.", buffer); set_level(u, SK_ALCHEMY, 1); bufunit(u->faction, u, 0, 0, buffer, sizeof(buffer)); - CuAssertStrEquals(tc, "Hodor (1), 1 human, status_aggressive, Talente: Segeln 1, Alchemie 2.", buffer); + CuAssertStrEquals(tc, "Hodor (1), 1 human, aggressiv, Talente: Segeln 1, Alchemie 2.", buffer); f = test_create_faction(0); f->locale = get_or_create_locale("de"); diff --git a/src/tests.c b/src/tests.c index 0511919c3..b8508b4cc 100644 --- a/src/tests.c +++ b/src/tests.c @@ -265,6 +265,7 @@ void test_create_world(void) locale_setstring(loc, parameters[P_ANY], "ALLE"); init_parameters(loc); + locale_setstring(loc, "status_aggressive", "aggressiv"); locale_setstring(loc, keyword(K_RESERVE), "RESERVIEREN"); locale_setstring(loc, "money", "SILBER"); init_resources(); @@ -280,7 +281,6 @@ void test_create_world(void) test_create_itemtype("iron"); test_create_itemtype("stone"); - t_plain = test_create_terrain("plain", LAND_REGION | FOREST_REGION | WALK_INTO | CAVALRY_REGION | SAIL_INTO | FLY_INTO); t_plain->size = 1000; t_plain->max_road = 100;