diff options
| author | jj | 2012-08-12 00:46:03 +0200 |
|---|---|---|
| committer | jj | 2012-08-12 00:46:03 +0200 |
| commit | eb524105653bd09a33eae2da6f21d1d1d5e6a530 (patch) | |
| tree | e93c24a26d41a8dc71d79e3633de25aff39c7a95 /scripts | |
| parent | 61185d29cae36bf8bd33287acd019ec0db50ce50 (diff) | |
| download | dfhack-eb524105653bd09a33eae2da6f21d1d1d5e6a530.tar.gz dfhack-eb524105653bd09a33eae2da6f21d1d1d5e6a530.tar.bz2 dfhack-eb524105653bd09a33eae2da6f21d1d1d5e6a530.tar.xz | |
fix/loyaltycascade: reset enemy_status_cache.next_slot too
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/fix/loyaltycascade.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/fix/loyaltycascade.rb b/scripts/fix/loyaltycascade.rb index 2f987bd5..6fad2947 100644 --- a/scripts/fix/loyaltycascade.rb +++ b/scripts/fix/loyaltycascade.rb @@ -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 |
