object global is complete nonsense

Reporter: fundies  |  Status: open  |  Last Modified: April 16, 2019, 01:12:03 AM

Here we construct a global object https://github.com/enigma-dev/enigma-dev/blob/master/CompilerSource/compiler/components/write_globals.cpp#L138 with arguments global,global but global is undefined. If that weren't silly enough, it then callls object_locals(_x,_y) with global, global then calls object_locals()->event_parent()->object_collisions() with the same undefined global,global but object_collisions() doesn't even take an x,y it takes (unsigned _id,int _objid) (thus shoving an int into an unsigned) and continues down a chain of initializing id's from undefined x/y coords until I end up with an object of id=-5 and x=4294967291.....
this is cause of #1612 btw

We've talked this over with Josh and everything here is correct except for the x coordinate overflow. None of this is actually the cause of #1612 though, the macro should just be changed to have special handling for the global instance where -5 is the correct id. This shit should also be better documented and additionally a few CI tests added to prevent regression.
Please sign in to post comments, or you can view this issue on GitHub.