Drop the max_entities resize for this test, and go through ALL your code and add the following line DIRECTLY after EVERY ent_create.
Code:
diag_var("Ents=%.0f\n",num_entities);
Then run it till you get the "not enough entities reserved" error. Then look in the acklog.txt file in your script folder and see how high the entities count actually got at the crash
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial