cleolibrary / CLEO5

CLEO 5 for GTA San Andreas
https://cleo.li
MIT License
57 stars 6 forks source link

Keep main script to be executed before custom scripts. #235

Open MiranDMC opened 5 days ago

MiranDMC commented 5 days ago

Fix to keep scripts execution order same as in CLEO4. Changed due to fact the multiple scripts initialization behavior was fixed. Tested with few custom scripts, main, mission and thread from main running at once. Fixes #60

MiranDMC commented 1 day ago

my gut feeling is that this is going to blow up, hoping that I'm wrong

This reflects exactly how script queue looks on startup in CLEO4. Also this is done before any script is processed yet, so queue contains just main script. No mission or script thread had chance to be spawned yet.

Hm after more thinking I'm not sure how and when scripts attached to map objects are spawned (like vending machines). This still needs to be checked.

x87 commented 1 day ago

they load when the object is spawned on the map, object handle is passed to the new script

MiranDMC commented 1 day ago

Ok in case of loading save game with original main scm it starts with multiple scripts already on list. Updated code to idea I had in first place, just append custom scripts queue at end of original queue.