May have found it.
After finding my second Kor's Fall again, I looked through game.teag. The main file showed that game.uniques was recording the artifact properly. Both times.
Code: Select all
d["uniques"]={
...
["mod.class.Object/Kor's Fall"]=2,
...
}
When creating an object, game.uniques is checked in game/engines/default/engine/Zone.lua by checkFilter(). However, if makeEntity is called with filter = nil, then it doesn't call checkFilter(), so the unique check is skipped.
Calling checkFilter(e, nil) in the non-filter branch of makeEntity should prevent unique duplication (unless there's another code path somewhere that creates entities and doesn't have the uniqueness check).
(although it does look a bit counterintuitive to call checkFilter without a filter...)
Tried to attach diff file, but board is rejecting both .diff and .txt extensions, and I don't feel like playing guess-the-allowed-extension...patch in the text here will probably be tab-damaged...is there a better way to submit a patch?
Patch is against SVN r2283.
Code: Select all
--- game/engines/default/engine/Zone-orig.lua 2011-01-08 03:10:15.000000000 -0500
+++ game/engines/default/engine/Zone.lua 2011-01-08 03:39:30.505331005 -0500
@@ -254,6 +254,8 @@
local list = level:getEntitiesList(type)
e = self:pickEntity(list)
if not e then return nil end
+ -- must call checkFilter() to prevent duplication of uniques (Noel)
+ if not self:checkFilter(e, nil) then return null end
end
if filter then e.force_ego = filter.force_ego end