06 Feb, 2010, jurdendurden wrote in the 1st comment:
Votes: 0
It would appear that mprogs listed on any given mob will load in reverse during a copyover. I have checked the load_mobprog and save_mobile functions and (from what I can tell) they seem to be fine. I will post them below to see if anyone else can discern an issue with them.
06 Feb, 2010, jurdendurden wrote in the 2nd comment:
Votes: 0
Also I'm not getting any errors in the logfiles, or while running GDB. They just load in complete reverse, making some of the mprog logic in the game so far nonsensical.
It looks like you are saving the programs in the order they are on the mob, but then loading in that same order but tacking them on the head (start) of the list. This puts the last loaded at the start of the list and in effect reversing the list. You could do a number of things: save the programs in reverse order. maintain a tail pointer and add the programs there. search to the end of the list and add there. to name a few.
This next part is from save_mobile, near the end: