forked from github/server
Katapulte die aus der hinteren Reihe nicht schiessen konnten, haben trotzdem nachgeladen.
This commit is contained in:
parent
f5b6d89c1b
commit
d6cd1c0efe
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue