Trying to get my Lua serializer to not die when it encounters circular dependencies.
Right now it does this:
Entity = {
__type = "mater.lua.tests.Test+Entity, mater.lua.tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null";
__hash = 58225482;
a = 16;
s = 50;
pos = {
__type = "mater.lua.tests.Test+Position, mater.lua.tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null";
__hash = 54267293;
x = 9;
y = 8;
e = {
__type = "mater.lua.tests.Test+Entity, mater.lua.tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null";
__hash = 58225482;
a = 16;
s = 50;
pos = {
__type = "mater.lua.tests.Test+Position, mater.lua.tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null";
__hash = 54267293;
x = 9;
y = 8;
e = {
__type = "mater.lua.tests.Test+Entity, mater.lua.tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null";
__hash = 58225482;
a = 16;
s = 50;
pos = {
__type = "mater.lua.tests.Test+Position, mater.lua.tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null";
__hash = 54267293;
x = 9;
y = 8;
e = {
a few hundred times and then crashes because of a stack overflow.
I kind of know what I'm going to do, but I'm not sure how.
Edit:
Wow, done already

Entity = {
__type = "mater.lua.tests.Test+Entity, mater.lua.tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null";
__hash = -1574713792;
a = 16;
s = 50;
pos = {
__type = "mater.lua.tests.Test+Position, mater.lua.tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null";
__hash = -18553600;
x = 9;
y = 8;
};
};
Entity.pos.e = Entity
__main = Entity;
I didn't think I'd be so fast. I guess I'll play some witcher 2 now
