From 54a3c2e07021d59d90b4b41e2fc13f3595cc1755 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 30 Jun 2014 19:25:08 -0700 Subject: [PATCH] recycle quota is always 0.5 in every game, no reason to toch this. --- src/kernel/jsonconf.c | 1 + src/kernel/jsonconf.test.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/kernel/jsonconf.c b/src/kernel/jsonconf.c index 0e36ad8f7..bdf12e431 100644 --- a/src/kernel/jsonconf.c +++ b/src/kernel/jsonconf.c @@ -75,6 +75,7 @@ static void json_requirements(cJSON *json, requirement **matp) { requirement *mat = calloc(sizeof(requirement), 1+cJSON_GetArraySize(json)); for (i=0,child=json->child;child;child=child->next,++i) { mat[i].number = child->valueint; + mat[i].recycle = 0.5f; mat[i].rtype = rt_get_or_create(child->string); } *matp = mat; diff --git a/src/kernel/jsonconf.test.c b/src/kernel/jsonconf.test.c index e422d4e63..1d9780f90 100644 --- a/src/kernel/jsonconf.test.c +++ b/src/kernel/jsonconf.test.c @@ -204,6 +204,7 @@ static void test_buildings(CuTest * tc) CuAssertPtrNotNull(tc, bt->construction); CuAssertPtrNotNull(tc, bt->construction->materials); CuAssertIntEquals(tc, 2, bt->construction->materials[0].number); + CuAssertDblEquals(tc, 0.5f, bt->construction->materials[0].recycle, 0.0f); CuAssertPtrEquals(tc, (void *)get_resourcetype(R_STONE), (void *)bt->construction->materials[0].rtype); CuAssertIntEquals(tc, 1, bt->construction->materials[1].number); CuAssertPtrEquals(tc, (void *)get_resourcetype(R_IRON), (void *)bt->construction->materials[1].rtype);