BUG 2326: Untote Helden fehlen in der Kampfübersicht

https://bugs.eressea.de/view.php?id=2326
This commit is contained in:
Enno Rehling 2017-05-21 11:09:45 +02:00
parent 1bc23beccc
commit 58d9aa58a0
4 changed files with 11 additions and 7 deletions

View File

@ -981,7 +981,7 @@ void move_unit(unit * u, region * r, unit ** ulist)
/* ist mist, aber wegen nicht skalierender attribute notwendig: */ /* ist mist, aber wegen nicht skalierender attribute notwendig: */
#include "alchemy.h" #include "alchemy.h"
void transfermen(unit * u, unit * dst, int n) void clone_men(unit * u, unit * dst, int n)
{ {
const attrib *a; const attrib *a;
int hp = u->hp; int hp = u->hp;
@ -1074,7 +1074,6 @@ void transfermen(unit * u, unit * dst, int n)
transfer_curse(u, dst, n); transfer_curse(u, dst, n);
} }
} }
scale_number(u, u->number - n);
if (dst) { if (dst) {
set_number(dst, dst->number + n); set_number(dst, dst->number + n);
hp -= u->hp; hp -= u->hp;
@ -1100,6 +1099,12 @@ void transfermen(unit * u, unit * dst, int n)
} }
} }
void transfermen(unit * u, unit * dst, int n)
{
clone_men(u, dst, n);
scale_number(u, u->number - n);
}
struct building *inside_building(const struct unit *u) struct building *inside_building(const struct unit *u)
{ {
if (!u->building) { if (!u->building) {

View File

@ -165,7 +165,8 @@ extern "C" {
void set_level(struct unit *u, skill_t id, int level); void set_level(struct unit *u, skill_t id, int level);
int get_level(const struct unit *u, skill_t id); int get_level(const struct unit *u, skill_t id);
extern void transfermen(struct unit *src, struct unit *dst, int n); void transfermen(struct unit *src, struct unit *dst, int n);
void clone_men(struct unit *src, struct unit *dst, int n); /* like transfer, but do not subtract from src */
int eff_skill(const struct unit *u, const struct skill *sv, const struct region *r); int eff_skill(const struct unit *u, const struct skill *sv, const struct region *r);
int effskill_study(const struct unit *u, skill_t sk, const struct region *r); int effskill_study(const struct unit *u, skill_t sk, const struct region *r);

View File

@ -1668,11 +1668,8 @@ int sp_undeadhero(struct castorder * co)
} }
/* transfer dead people to new unit, set hitpoints to those of old unit */ /* transfer dead people to new unit, set hitpoints to those of old unit */
transfermen(du, u, j); clone_men(du, u, j); /* for reporting reasons, do not remove the dead */
u->hp = u->number * unit_max_hp(du); u->hp = u->number * unit_max_hp(du);
assert(j <= df->side->casualties);
df->side->casualties -= j;
df->side->dead -= j;
/* counting total number of undead */ /* counting total number of undead */
undead += j; undead += j;

View File

@ -3,6 +3,7 @@ IF EXIST ..\build-vs10 SET BUILD=..\build-vs10\eressea\Debug
IF EXIST ..\build-vs11 SET BUILD=..\build-vs11\eressea\Debug IF EXIST ..\build-vs11 SET BUILD=..\build-vs11\eressea\Debug
IF EXIST ..\build-vs12 SET BUILD=..\build-vs12\eressea\Debug IF EXIST ..\build-vs12 SET BUILD=..\build-vs12\eressea\Debug
IF EXIST ..\build-vs14 SET BUILD=..\build-vs14\eressea\Debug IF EXIST ..\build-vs14 SET BUILD=..\build-vs14\eressea\Debug
REM IF EXIST ..\build-vs15 SET BUILD=..\build-vs15\eressea\Debug
SET SERVER=%BUILD%\eressea.exe SET SERVER=%BUILD%\eressea.exe
%BUILD%\test_eressea.exe %BUILD%\test_eressea.exe
%SERVER% ..\scripts\run-tests.lua %SERVER% ..\scripts\run-tests.lua