forked from github/server
recycle quota is always 0.5 in every game, no reason to toch this.
This commit is contained in:
parent
927ada92b6
commit
54a3c2e070
2 changed files with 2 additions and 0 deletions
|
@ -75,6 +75,7 @@ static void json_requirements(cJSON *json, requirement **matp) {
|
||||||
requirement *mat = calloc(sizeof(requirement), 1+cJSON_GetArraySize(json));
|
requirement *mat = calloc(sizeof(requirement), 1+cJSON_GetArraySize(json));
|
||||||
for (i=0,child=json->child;child;child=child->next,++i) {
|
for (i=0,child=json->child;child;child=child->next,++i) {
|
||||||
mat[i].number = child->valueint;
|
mat[i].number = child->valueint;
|
||||||
|
mat[i].recycle = 0.5f;
|
||||||
mat[i].rtype = rt_get_or_create(child->string);
|
mat[i].rtype = rt_get_or_create(child->string);
|
||||||
}
|
}
|
||||||
*matp = mat;
|
*matp = mat;
|
||||||
|
|
|
@ -204,6 +204,7 @@ static void test_buildings(CuTest * tc)
|
||||||
CuAssertPtrNotNull(tc, bt->construction);
|
CuAssertPtrNotNull(tc, bt->construction);
|
||||||
CuAssertPtrNotNull(tc, bt->construction->materials);
|
CuAssertPtrNotNull(tc, bt->construction->materials);
|
||||||
CuAssertIntEquals(tc, 2, bt->construction->materials[0].number);
|
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);
|
CuAssertPtrEquals(tc, (void *)get_resourcetype(R_STONE), (void *)bt->construction->materials[0].rtype);
|
||||||
CuAssertIntEquals(tc, 1, bt->construction->materials[1].number);
|
CuAssertIntEquals(tc, 1, bt->construction->materials[1].number);
|
||||||
CuAssertPtrEquals(tc, (void *)get_resourcetype(R_IRON), (void *)bt->construction->materials[1].rtype);
|
CuAssertPtrEquals(tc, (void *)get_resourcetype(R_IRON), (void *)bt->construction->materials[1].rtype);
|
||||||
|
|
Loading…
Reference in a new issue