fix a crash in battles caused by quicklist changes

This commit is contained in:
Enno Rehling 2011-03-01 04:55:58 +01:00
parent 42eb0ef0ed
commit 2af300431d

View file

@ -2301,8 +2301,10 @@ add_tactics(tactics * ta, fighter * fig, int value)
{ {
if (value == 0 || value < ta->value) if (value == 0 || value < ta->value)
return; return;
if (value > ta->value) if (value > ta->value) {
ql_free(ta->fighters); ql_free(ta->fighters);
ta->fighters = 0;
}
ql_push(&ta->fighters, fig); ql_push(&ta->fighters, fig);
ql_push(&fig->side->battle->leaders, fig); ql_push(&fig->side->battle->leaders, fig);
ta->value = value; ta->value = value;