Try removing the sky entity from your game, completely. Especially if it has a (big) texture. Those things are quite suspicious to me (I had random polygons/ planes visible in my levels at some point, many years ago, and some objects missing after level load - turned out for some reason the big skybox texture/ sky entity caused it - or seemed to have caused it).


Many years ago I wrote a program in lite-C to solve a puzzle. The first algorithm was implemented recursively. It worked fine up to tile 100-150 maybe, then it got weird. It would tackle the wrong tiles after that, change stuff or regard stuff as wrong/ correct erroneously.
I had to learn that stack memory is limited, and the allocation of
short short_array_x1024[1024];
might "fail" or be not quite what you wanted after some recursion.
This most likely does not apply in/to your case but sharing it might be useful for you after all.
It's probably better to sys_malloc (and sys_free) large(r) arrays dynamically.

Originally Posted By: Turrican
I recently learned that local STRING* pointers should a) be created using str_create()

STRING(*) pointers do not need to be manually allocated, STRING objects/ "instances" do though.

Code:
STRING* strPointer = NULL; // you could write for example void* as well instead of STRING*
strPointer = localisationGetString(DIALOG_001); // returns a "constant" string, for example a text.pstring element
[use strPointer for further non-manipulation/ drawing text]


If you want to manipulate the string you should str_create("") a new STRING object though:

Code:
STRING* strPointer = str_create("");
[manipulate and use string...]
ptr_remove(strPointer); // every str_create needs to have a ptr_remove



You can write stuff like [STRING* strPointerArray[10];] as well, of course. Depends on what you want to do with it though. If you write
Code:
char* _nameFINAL[10];


then you will have an array of 10 char pointers. _nameFINAL does not sound like that's what you were going for.
char _nameFINAL[10];
pretty much is a pointer named _nameFINAL that points to 10 (char) bytes, which you can use for string/ char manipulation/ a 9 digit name.
Example:
Code:
char _nameFINAL[10];
_nameFINAL[0] = 'A'; // or _nameFINAL[0] = 65;
_nameFINAL[1] = '8';
_nameFINAL[2] = '';
draw_text(_nameFINAL,400,400,COLOR_RED);
or something like str_cat(strPointer,_nameFINAL);



If you write something like
char* myChr = "Wow!";
you should treat that as static, don't write into it.
STRING* myStr = "Wow!"; // inside a function in this case
is just a pointer (which could be void* as well) that points to a static char array (if I'm not mistaken), and should not be changed/ probably not what you want.



What I usually do (although it may be frowned upon) I have a bunch of global objects
STRING* tmpStr1 = "";
STRING* tmpStr2 = "";
STRING* tmpStr3 = "";
I use them in functions for temporary string manipulation so I don't have to str_create/ ptr_remove every time.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends