I had a problem in the physics demo level that I've been putting together, I had entities that suddenly had zero weight which meant that I couldn't do anything physical with them.
Took me a while to figure out what the failing entities had in common but eventually I realised that it was happening with entity ids greater than 400, i.e. any entity I added after 400 had already been placed, even if I deleted a bunch of entities and added new ones this still happened.
So being a masochist I did a search in the repository code (all of it!) for "400" and after wading through many pages of red herrings found the offending bit of code. Basically due to a simple error in the code only the first 400 entities were having their properties read correctly and subsequently being correctly set up in the game engine.
I went a step further and searched the code again to see if the same simple error was duplicated and found that indeed it was although these secondary occurrences appeared more benign.
Having fixed the ones I found I then reloaded the fpm and discovered that the problem was still there, even saving a new fpm from the old one didn't fix the problem. But a completely new level with more than 400 entities works fine now.
!!! Correction !!! The cause of my problem is that for some reason that I haven't tracked down yet the g_Entity[e].obj value was not set when the level is first run. Some time later the value does get set but this means that the 'init' script for the entity has already been executed.
I have a workaround in my script and I am reworking the physlib to make allowance for this eventuality as well.
So my original map file is working again now!
I will still attempt to work out why the value is not set, even for 'always-active' entities right next to the player spawn position, as this could effect other scripts.
Been there, done that, got all the T-Shirts!