object global is complete nonsense

Reporter: fundies  |  Status: open  |  Last Modified: May 20, 2019, 01:47:30 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.....
fundies  
this is cause of #1612 btw
RobertBColton  

We've talked this over with Josh and everything here is correct. The macro should 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.

cher-nov  

@RobertBColton, a bit off-topic: maybe you'll be interested in the actual meaning of missing -6: it's a so-called "unspecified scope" (proof). AFAIK, it's used only for some error messages in pre-Studio versions of GM.
Please sign in to post comments, or you can view this issue on GitHub.