forked from github/server
Bugfix: Untote Helden bekamen keine Beute.
https://bugs.eressea.de/view.php?id=1962
This commit is contained in:
parent
3a1e4ab7f5
commit
1ae44db7ca
|
@ -2719,7 +2719,7 @@ static void aftermath(battle * b)
|
|||
fset(sh, SF_DAMAGED);
|
||||
}
|
||||
|
||||
if (df->alive == du->number) {
|
||||
if (df->alive && df->alive == du->number) {
|
||||
du->hp = sum_hp;
|
||||
continue; /* nichts passiert */
|
||||
}
|
||||
|
|
|
@ -459,7 +459,7 @@ damage_unit(unit * u, const char *dam, bool physical, bool magic)
|
|||
return 0;
|
||||
}
|
||||
|
||||
assert(u->number > u->hp);
|
||||
assert(u->number <= u->hp);
|
||||
h = u->hp / u->number;
|
||||
/* HP verteilen */
|
||||
for (i = 0; i < u->number; i++)
|
||||
|
|
|
@ -1737,6 +1737,7 @@ int sp_undeadhero(struct castorder * co)
|
|||
}
|
||||
|
||||
if (j > 0) {
|
||||
item **ilist;
|
||||
unit *u =
|
||||
create_unit(r, mage->faction, 0, get_race(RC_UNDEAD), 0, du->name,
|
||||
du);
|
||||
|
@ -1750,6 +1751,21 @@ int sp_undeadhero(struct castorder * co)
|
|||
}
|
||||
setstatus(u, du->status);
|
||||
setguard(u, GUARD_NONE);
|
||||
for (ilist = &du->items; *ilist;) {
|
||||
item *itm = *ilist;
|
||||
int loot = itm->number * j / du->number;
|
||||
if (loot != itm->number) {
|
||||
int split = itm->number * j % du->number;
|
||||
if (split > 0 && (rng_int() % du->number) < split) {
|
||||
++loot;
|
||||
}
|
||||
}
|
||||
i_change(&u->items, itm->type, loot);
|
||||
i_change(ilist, itm->type, -loot);
|
||||
if (*ilist == itm) {
|
||||
ilist = &itm->next;
|
||||
}
|
||||
}
|
||||
|
||||
/* inherit stealth from magician */
|
||||
if (fval(mage, UFL_ANON_FACTION)) {
|
||||
|
|
Loading…
Reference in New Issue