remov e the old recycling quota, it was always 0.5 everywhere, and a

silly feature..
This commit is contained in:
Enno Rehling 2014-07-01 20:36:31 -07:00
parent 54a3c2e070
commit ee1d97df19
5 changed files with 1 additions and 9 deletions

View File

@ -66,10 +66,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <attributes/matmod.h>
#include <attributes/alliance.h>
#define STONERECYCLE 50
/* Name, MaxGroesse, MinBauTalent, Kapazitaet, {Eisen, Holz, Stein, BauSilber,
* Laen, Mallorn}, UnterSilber, UnterSpezialTyp, UnterSpezial */
struct building *getbuilding(const struct region *r)
{
building *b = findbuilding(getid());
@ -240,7 +236,7 @@ int destroy_cmd(unit * u, struct order *ord)
int c;
for (c = 0; con->materials[c].number; ++c) {
const requirement *rq = con->materials + c;
int recycle = (int)(rq->recycle * rq->number * size / con->reqsize);
int recycle = (rq->number * size / con->reqsize)/2;
if (recycle) {
change_resource(u, rq->rtype, recycle);
}

View File

@ -37,7 +37,6 @@ extern "C" {
typedef struct requirement {
const struct resource_type *rtype;
int number;
double recycle; /* recycling quota */
} requirement;
typedef struct construction {

View File

@ -75,7 +75,6 @@ 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,7 +204,6 @@ 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);

View File

@ -122,7 +122,6 @@ xml_readrequirements(xmlNodePtr * nodeTab, int nodeNr, requirement ** reqArray)
xmlChar *propValue;
radd->number = xml_ivalue(node, "quantity", 1);
radd->recycle = xml_fvalue(node, "recycle", 0.5);
propValue = xmlGetProp(node, BAD_CAST "type");
radd->rtype = rt_get_or_create((const char *)propValue);