From e6b3a6da65f3644ccc1324aecd89dde2733e1558 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 17 Jun 2015 07:54:56 +0200 Subject: [PATCH] suppress valgrind warning form issue #227 --- src/battle.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/battle.c b/src/battle.c index db2dbc3ca..9fb58751d 100644 --- a/src/battle.c +++ b/src/battle.c @@ -901,7 +901,9 @@ static void rmtroop(troop dt) rmfighter(df, 1); assert(dt.index >= 0 && dt.index < df->unit->number); - df->person[dt.index] = df->person[df->alive - df->removed]; + if (dt.index!=df->alive-df->removed) { + df->person[dt.index] = df->person[df->alive - df->removed]; + } if (df->removed) { df->person[df->alive - df->removed] = df->person[df->alive]; }