[1.6 and 1.7 beta 3] ai_actors_seen resource leak

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
minmay
Wyrmic
Posts: 286
Joined: Fri Sep 07, 2012 1:34 am
Contact:

[1.6 and 1.7 beta 3] ai_actors_seen resource leak

#1 Post by minmay »

The ai_actors_seen field introduced in 1.6 stores a reference to every other actor that an AI-controlled actor has seen, as keys. This table is supposed to be marked as having weak keys, however, horrifyingly, it appears to...not be. Looking at the code it really seems like it should always be, but when I check with the in-game Lua console, "=getmetatable(game.player.ai_actors_seen)" returns nil. Same for any other actor.

I noticed this bug because my possessor saves started failing entirely after around 20 Projection uses. Using Projection makes a clone of you that will immediately get stuck in the player character's ai_actors_seen forever, which can very quickly ruin a savegame since the clone includes all the crap you're carrying etc.
Luckily the save files are easy to fix manually, but this is still quite a scary bug!

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: [1.6 and 1.7 beta 3] ai_actors_seen resource leak

#2 Post by darkgod »

ouch yes .. fixing, thanks
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: [1.6 and 1.7 beta 3] ai_actors_seen resource leak

#3 Post by darkgod »

Fixed! that was an interesting trip ;)
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply