fix/loyaltycascade: reset enemy_status_cache.next_slot too

develop
jj 2012-08-12 00:46:03 +02:00
parent 61185d29ca
commit eb52410565
1 changed files with 5 additions and 3 deletions

@ -41,9 +41,11 @@ def fixunit(unit)
if fixed and unit.unknown8.enemy_status_slot != -1
i = unit.unknown8.enemy_status_slot
unit.unknown8.enemy_status_slot = -1
df.world.enemy_status_cache.slot_used[i] = false
df.world.enemy_status_cache.rel_map[i].map! { -1 }
df.world.enemy_status_cache.rel_map.each { |a| a[i] = -1 }
cache = df.world.enemy_status_cache
cache.slot_used[i] = false
cache.rel_map[i].map! { -1 }
cache.rel_map.each { |a| a[i] = -1 }
cache.next_slot = i if cache.next_slot > i
end
# return true if we actually fixed the unit