DrLex
09-10-2003, 02:14 PM
This is not a real bug, but rather lack of protection against a bug in map files:
While playing the Extreme ROTT levels, I often encountered crashes when stepping on some touchplates. These crashes occur in both OS X and Linux, but not in the original DOS version. There, all those nasty touchplates are treated as if they have already been stepped upon.
After some debugging, I found out that they have NULL pointers in the 'touchplate' array (probably the developer of the level forgot to attach an action to them.) Apparently DOS doesn't care about the game accessing memory in the system area, and by chance the right byte has the right value, therefore it doesn't crash. So this behavior can be simulated by adding a few extra checks:
in rt_playr.c around line 3765:
change:
if (touchplate[index-1]->complete)
into:
if (touchplate[index-1] == NULL || touchplate[index-1]->complete)
in rt_door around 753:
change:
else if (touchplate[i]->complete)
into:
else if (touchplate[i] == NULL || touchplate[i]->complete)
While playing the Extreme ROTT levels, I often encountered crashes when stepping on some touchplates. These crashes occur in both OS X and Linux, but not in the original DOS version. There, all those nasty touchplates are treated as if they have already been stepped upon.
After some debugging, I found out that they have NULL pointers in the 'touchplate' array (probably the developer of the level forgot to attach an action to them.) Apparently DOS doesn't care about the game accessing memory in the system area, and by chance the right byte has the right value, therefore it doesn't crash. So this behavior can be simulated by adding a few extra checks:
in rt_playr.c around line 3765:
change:
if (touchplate[index-1]->complete)
into:
if (touchplate[index-1] == NULL || touchplate[index-1]->complete)
in rt_door around 753:
change:
else if (touchplate[i]->complete)
into:
else if (touchplate[i] == NULL || touchplate[i]->complete)