Lua Bug -- Game:SetProperty(), Game:GetProperty()

Joined
Oct 20, 2007
Messages
470
Location
Spokane, WA
Noticed this problem today. Wasn't doing it a couple months ago. At least, I don't think it was? Base game.

When using SetProperty() and GetProperty() on the Game global, a table containing a table for a key returns zero for the key instead.

-----------
Game:SetProperty( "test", { [ {} ] = "problem" } ); -- a table for a table key goes in.
local data = Game:GetProperty( "test" ); -- zero for table key comes out instead.
-----------
data: { [ 0 ] = "problem" }

All mods are disabled except for the lua file running this code. This may also be true of set and get properties for pPlayer, pPlot, and pUnit. I haven't tested it. I sent a bug report to 2K, but the auto response would seem to suggest no one is ever going to read it.
 
Last edited:
Top Bottom