forked from github/server
crashbugs in randenc und rostregen
This commit is contained in:
parent
9ba5ebedb9
commit
873404d8f4
|
@ -167,19 +167,22 @@ dissolve_units(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
improve_all(faction * f, skill_t sk, int weeks)
|
improve_all(faction * f, skill_t sk, int by_weeks)
|
||||||
{
|
{
|
||||||
unit *u;
|
unit *u;
|
||||||
|
boolean ret = by_weeks;
|
||||||
|
|
||||||
for (u = f->units; u; u = u->nextF) {
|
for (u = f->units; u; u = u->nextF) {
|
||||||
if (has_skill(u, sk)) {
|
if (has_skill(u, sk)) {
|
||||||
while (weeks--) {
|
int weeks = 0;
|
||||||
|
for (;weeks!=by_weeks;++weeks) {
|
||||||
learn_skill(u, sk, 1.0);
|
learn_skill(u, sk, 1.0);
|
||||||
|
ret = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return weeks;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -1348,7 +1348,7 @@ sp_rosthauch(castorder *co)
|
||||||
|
|
||||||
for (;iweapon!=NULL;iweapon=iweapon->next) {
|
for (;iweapon!=NULL;iweapon=iweapon->next) {
|
||||||
item ** ip = i_find(&u->items, iweapon->type);
|
item ** ip = i_find(&u->items, iweapon->type);
|
||||||
if (ip) {
|
if (*ip) {
|
||||||
int i = min((*ip)->number, force);
|
int i = min((*ip)->number, force);
|
||||||
if (iweapon->chance<1.0) {
|
if (iweapon->chance<1.0) {
|
||||||
i = (int)(i*iweapon->chance);
|
i = (int)(i*iweapon->chance);
|
||||||
|
@ -1368,10 +1368,10 @@ sp_rosthauch(castorder *co)
|
||||||
if (ironweapon>0) {
|
if (ironweapon>0) {
|
||||||
/* {$mage mage} legt einen Rosthauch auf {target}. {amount} Waffen
|
/* {$mage mage} legt einen Rosthauch auf {target}. {amount} Waffen
|
||||||
* wurden vom Rost zerfressen */
|
* wurden vom Rost zerfressen */
|
||||||
ADDMSG(&mage->faction->msgs, msg_message(
|
ADDMSG(&mage->faction->msgs, msg_message("rust_effect",
|
||||||
"rust_effect", "mage target amount", mage, u, ironweapon));
|
"mage target amount", mage, u, ironweapon));
|
||||||
ADDMSG(&u->faction->msgs, msg_message(
|
ADDMSG(&u->faction->msgs, msg_message("rust_effect",
|
||||||
"rust_effect", "mage target amount",
|
"mage target amount",
|
||||||
cansee(u->faction, r, mage, 0) ? mage:NULL, u, ironweapon));
|
cansee(u->faction, r, mage, 0) ? mage:NULL, u, ironweapon));
|
||||||
success += ironweapon;
|
success += ironweapon;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -408,7 +408,7 @@ get_island(region * root, region_list ** rlist)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
island_size(region * r)
|
island_size(region * r)
|
||||||
{
|
{
|
||||||
int size = 0;
|
int size = 0;
|
||||||
|
@ -424,7 +424,11 @@ island_size(region * r)
|
||||||
for (d=0;d!=MAXDIRECTIONS;++d) {
|
for (d=0;d!=MAXDIRECTIONS;++d) {
|
||||||
region * rn = rconnect(r, d);
|
region * rn = rconnect(r, d);
|
||||||
if (rn && !fval(rn, FL_MARK) && rn->land) {
|
if (rn && !fval(rn, FL_MARK) && rn->land) {
|
||||||
add_regionlist(&rlist->next, rn);
|
region_list * rnew = malloc(sizeof(region_list));
|
||||||
|
rnew->data = rn;
|
||||||
|
rnew->next = rlist->next;
|
||||||
|
rlist->next = rnew;
|
||||||
|
fset(rn, FL_MARK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rlist = rlist->next;
|
rlist = rlist->next;
|
||||||
|
|
|
@ -8,7 +8,7 @@ end
|
||||||
|
|
||||||
function change_locales()
|
function change_locales()
|
||||||
-- local localechange = { }
|
-- local localechange = { }
|
||||||
local localechange = { en = { "bLub" } }
|
local localechange = { de = { "2xwr" } }
|
||||||
|
|
||||||
for loc, flist in localechange do
|
for loc, flist in localechange do
|
||||||
for index, name in flist do
|
for index, name in flist do
|
||||||
|
|
Loading…
Reference in New Issue