recycle quota is always 0.5 in every game, no reason to toch this.

This commit is contained in:
Enno Rehling 2014-06-30 19:25:08 -07:00
parent 927ada92b6
commit 54a3c2e070
2 changed files with 2 additions and 0 deletions

View File

@ -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;

View File

@ -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);