diff --git a/src/common/items/weapons.c b/src/common/items/weapons.c index d7abb83bc..f79b94397 100644 --- a/src/common/items/weapons.c +++ b/src/common/items/weapons.c @@ -207,8 +207,10 @@ attack_catapult(const troop * at, int * casualties, int row) weapon * wp = af->person[at->index].missile; assert(row>=FIGHT_ROW); - if (row>BEHIND_ROW) return false; /* keine weiteren attacken */ - + if (row>BEHIND_ROW) { + /* probiere noch weitere attacken, kann nicht schiessen */ + return true; + } assert(wp->type->itype==olditemtype[I_CATAPULT]); assert(af->person[at->index].reload==0); diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index 5ea87de27..ef068b7b6 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -2001,18 +2001,15 @@ attack(battle *b, troop ta, const att *a, int numattack) ta.fighter->person[ta.index].reload--; } else { boolean standard_attack = true; - + boolean reload = false; /* spezialattacken der waffe nur, wenn erste attacke in der runde. * sonst helden mit feuerschwertern zu mächtig */ if (numattack==0 && wp && wp->type->attack) { int dead = 0; standard_attack = wp->type->attack(&ta, &dead, row); + if (!standard_attack) reload = true; af->catmsg += dead; - /* TODO: dies hier ist nicht richtig. wenn die katapulte/etc. - * keinen gegner gefunden haben, sollte es nicht erhöht werden. - * außerdem müsste allen gegenern der counter erhöht werden. - */ - if (af->person[ta.index].last_action < b->turn) { + if (!standard_attack && af->person[ta.index].last_action < b->turn) { af->person[ta.index].last_action = b->turn; af->action_counter++; } @@ -2038,7 +2035,7 @@ attack(battle *b, troop ta, const att *a, int numattack) ta.fighter->person[ta.index].last_action = b->turn; ta.fighter->action_counter++; } - + reload = true; if (hits(ta, td, wp)) { const char * d; if (wp == NULL) d = au->race->def_damage; @@ -2047,7 +2044,7 @@ attack(battle *b, troop ta, const att *a, int numattack) terminate(td, ta, a->type, d, missile); } } - if (wp && wp->type->reload && !getreload(ta)) { + if (reload && wp && wp->type->reload && !getreload(ta)) { int i = setreload(ta); sprintf(buf, " Nachladen gesetzt: %d", i); battledebug(buf); diff --git a/src/common/kernel/region.h b/src/common/kernel/region.h index 73003c1a0..c7b388a9e 100644 --- a/src/common/kernel/region.h +++ b/src/common/kernel/region.h @@ -191,10 +191,11 @@ void rsethorses(const struct region * r, int value); #define riron(r) ((r)->land?(r)->land->iron:0) #define rsetiron(r, value) ((r)->land?((r)->land->iron=(value)):(value),0) -int rlaen(const struct region * r); -void rsetlaen(struct region * r, int value); #endif /* NEW_RESOURCEGROWTH */ +extern int rlaen(const struct region * r); +extern void rsetlaen(struct region * r, int value); + #define rherbtype(r) ((r)->land?(r)->land->herbtype:0) #define rsetherbtype(r, value) ((r)->land?((r)->land->herbtype=(value)):(value),0)