suppress valgrind warning form issue #227

This commit is contained in:
Enno Rehling 2015-06-17 07:54:56 +02:00
parent 32bd8c4353
commit e6b3a6da65
1 changed files with 3 additions and 1 deletions

View File

@ -901,7 +901,9 @@ static void 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]; if (dt.index!=df->alive-df->removed) {
df->person[dt.index] = df->person[df->alive - df->removed];
}
if (df->removed) { if (df->removed) {
df->person[df->alive - df->removed] = df->person[df->alive]; df->person[df->alive - df->removed] = df->person[df->alive];
} }