forked from github/server
fixing adamant seeding
This commit is contained in:
parent
784a489830
commit
22d63cc8cf
3 changed files with 5 additions and 3 deletions
|
@ -155,8 +155,8 @@ region_getresource(const region& r, const char * type)
|
||||||
{
|
{
|
||||||
const resource_type * rtype = rt_find(type);
|
const resource_type * rtype = rt_find(type);
|
||||||
if (rtype!=NULL) {
|
if (rtype!=NULL) {
|
||||||
const rawmaterial * rm = r.resources;
|
const rawmaterial * rm;
|
||||||
while (rm) {
|
for (rm=r.resources;rm;rm=rm->next) {
|
||||||
if (rm->type->rtype==rtype) {
|
if (rm->type->rtype==rtype) {
|
||||||
return rm->amount;
|
return rm->amount;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ adamantium_island(region * r)
|
||||||
region * ri = rp->data;
|
region * ri = rp->data;
|
||||||
if (ri->terrain==newterrain(T_MOUNTAIN)) {
|
if (ri->terrain==newterrain(T_MOUNTAIN)) {
|
||||||
int base = 1 << (rng_int() % 4);
|
int base = 1 << (rng_int() % 4);
|
||||||
seed_adamantium(r, base);
|
seed_adamantium(ri, base);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free_regionlist(rlist);
|
free_regionlist(rlist);
|
||||||
|
|
|
@ -17,7 +17,9 @@ end
|
||||||
function adamant_seeds()
|
function adamant_seeds()
|
||||||
for r in regions() do
|
for r in regions() do
|
||||||
if r:get_key("tnnL") then
|
if r:get_key("tnnL") then
|
||||||
|
print("1 ", r:get_resource("adamantium"), r)
|
||||||
test.adamantium_island(r)
|
test.adamantium_island(r)
|
||||||
|
print("2 ", r:get_resource("adamantium"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue