forked from github/server
- SIGSEGV in claim_cmd wenn item nicht besessen
- Riesige Hitpoints: In Kämpfen wurde u->no mit u->number verwechselt - Bei Versteinerung wurde rmtroop nicht korrekt gemacht
This commit is contained in:
parent
cc4e6f6b6d
commit
cdca9107a5
|
@ -3665,7 +3665,7 @@ claim_cmd(unit * u, struct order * ord)
|
||||||
|
|
||||||
if (itype!=NULL) {
|
if (itype!=NULL) {
|
||||||
item ** iclaim = i_find(&u->faction->items, itype);
|
item ** iclaim = i_find(&u->faction->items, itype);
|
||||||
if (iclaim!=NULL) {
|
if (iclaim!=NULL && *iclaim!=NULL) {
|
||||||
n = min(n, (*iclaim)->number);
|
n = min(n, (*iclaim)->number);
|
||||||
i_change(iclaim, itype, -n);
|
i_change(iclaim, itype, -n);
|
||||||
i_change(&u->items, itype, n);
|
i_change(&u->items, itype, n);
|
||||||
|
|
|
@ -880,8 +880,11 @@ rmtroop(troop dt)
|
||||||
rmfighter(df, 1);
|
rmfighter(df, 1);
|
||||||
|
|
||||||
assert(dt.index >= 0 && dt.index < df->unit->number);
|
assert(dt.index >= 0 && dt.index < df->unit->number);
|
||||||
df->person[dt.index] = df->person[df->alive - df->removed];
|
df->person[dt.index] = df->person[df->alive - df->removed];
|
||||||
df->person[df->alive - df->removed].hp = 0;
|
if (df->removed) {
|
||||||
|
df->person[df->alive - df->removed] = df->person[df->alive];
|
||||||
|
}
|
||||||
|
df->person[df->alive].hp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -2559,8 +2562,8 @@ aftermath(battle * b)
|
||||||
}
|
}
|
||||||
if (du->hp < du->number) {
|
if (du->hp < du->number) {
|
||||||
log_error(("%s has less hitpoints (%u) than people (%u)\n",
|
log_error(("%s has less hitpoints (%u) than people (%u)\n",
|
||||||
itoa36(du->no), du->hp, du->number));
|
itoa36(du->no), du->hp, du->number));
|
||||||
du->hp=du->no;
|
du->hp = du->number;
|
||||||
}
|
}
|
||||||
} cv_next(df);
|
} cv_next(df);
|
||||||
s->alive+=s->healed;
|
s->alive+=s->healed;
|
||||||
|
|
|
@ -158,11 +158,11 @@ extern "C" {
|
||||||
struct item * loot;
|
struct item * loot;
|
||||||
int catmsg; /* Merkt sich, ob Katapultmessage schon generiert. */
|
int catmsg; /* Merkt sich, ob Katapultmessage schon generiert. */
|
||||||
struct person {
|
struct person {
|
||||||
|
int hp; /* Trefferpunkte der Personen */
|
||||||
int attack : 8; /* (Magie) Attackenbonus der Personen */
|
int attack : 8; /* (Magie) Attackenbonus der Personen */
|
||||||
int defence : 8; /* (Magie) Paradenbonus der Personen */
|
int defence : 8; /* (Magie) Paradenbonus der Personen */
|
||||||
int damage : 8; /* (Magie) Schadensbonus der Personen im Nahkampf */
|
int damage : 8; /* (Magie) Schadensbonus der Personen im Nahkampf */
|
||||||
int damage_rear : 8; /* (Magie) Schadensbonus der Personen im Fernkampf */
|
int damage_rear : 8; /* (Magie) Schadensbonus der Personen im Fernkampf */
|
||||||
int hp : 16; /* Trefferpunkte der Personen */
|
|
||||||
int flags : 8; /* (Magie) Diverse Flags auf Kämpfern */
|
int flags : 8; /* (Magie) Diverse Flags auf Kämpfern */
|
||||||
int speed : 8; /* (Magie) Geschwindigkeitsmultiplkator. */
|
int speed : 8; /* (Magie) Geschwindigkeitsmultiplkator. */
|
||||||
int reload : 4; /* Anzahl Runden, die die Waffe x noch laden muss.
|
int reload : 4; /* Anzahl Runden, die die Waffe x noch laden muss.
|
||||||
|
|
Loading…
Reference in New Issue