- SW: added validation checks to WallSetup.

This code wrote to array index -1.
With this change the level finally gets rendered, although it still doesn't work.
This commit is contained in:
Christoph Oelckers 2019-11-19 23:04:22 +01:00
parent fd31d4fa6a
commit 234283ca8a

View file

@ -185,6 +185,7 @@ WallSetup(void)
// set first wall
SET(wp->extra, WALLFX_LOOP_DONT_SPIN);
if (wp->nextwall >= 0)
SET(wall[wp->nextwall].extra, WALLFX_LOOP_DONT_SPIN);
// move the the next wall
@ -196,6 +197,7 @@ WallSetup(void)
wall_num = wall[wall_num].point2)
{
SET(wall[wall_num].extra, WALLFX_LOOP_DONT_SPIN);
if (wall[wall_num].nextwall >= 0)
SET(wall[wall[wall_num].nextwall].extra, WALLFX_LOOP_DONT_SPIN);
}
@ -208,6 +210,7 @@ WallSetup(void)
// set first wall
SET(wp->extra, WALLFX_DONT_SCALE);
if (wp->nextwall >= 0)
SET(wall[wp->nextwall].extra, WALLFX_DONT_SCALE);
// move the the next wall
@ -237,6 +240,7 @@ WallSetup(void)
// set first wall
SET(wp->extra, WALLFX_LOOP_OUTER|WALLFX_LOOP_OUTER_SECONDARY);
if (wp->nextwall >= 0)
SET(wall[wp->nextwall].extra, WALLFX_LOOP_OUTER|WALLFX_LOOP_OUTER_SECONDARY);
// move the the next wall
@ -248,6 +252,7 @@ WallSetup(void)
wall_num = wall[wall_num].point2)
{
SET(wall[wall_num].extra, WALLFX_LOOP_OUTER|WALLFX_LOOP_OUTER_SECONDARY);
if (wall[wall_num].nextwall >= 0)
SET(wall[wall[wall_num].nextwall].extra, WALLFX_LOOP_OUTER|WALLFX_LOOP_OUTER_SECONDARY);
}
@ -263,6 +268,7 @@ WallSetup(void)
// set first wall
SET(wp->extra, WALLFX_LOOP_OUTER);
if (wp->nextwall >= 0)
SET(wall[wp->nextwall].extra, WALLFX_LOOP_OUTER);
// move the the next wall
@ -274,6 +280,7 @@ WallSetup(void)
wall_num = wall[wall_num].point2)
{
SET(wall[wall_num].extra, WALLFX_LOOP_OUTER);
if (wall[wall_num].nextwall >= 0)
SET(wall[wall[wall_num].nextwall].extra, WALLFX_LOOP_OUTER);
}
@ -295,6 +302,7 @@ WallSetup(void)
// set first wall
SET(wp->extra, WALLFX_LOOP_SPIN_2X);
if (wp->nextwall >= 0)
SET(wall[wp->nextwall].extra, WALLFX_LOOP_SPIN_2X);
// move the the next wall
@ -306,6 +314,7 @@ WallSetup(void)
wall_num = wall[wall_num].point2)
{
SET(wall[wall_num].extra, WALLFX_LOOP_SPIN_2X);
if (wall[wall_num].nextwall >= 0)
SET(wall[wall[wall_num].nextwall].extra, WALLFX_LOOP_SPIN_2X);
}
@ -318,6 +327,7 @@ WallSetup(void)
// set first wall
SET(wp->extra, WALLFX_LOOP_SPIN_4X);
if (wp->nextwall >= 0)
SET(wall[wp->nextwall].extra, WALLFX_LOOP_SPIN_4X);
// move the the next wall
@ -329,6 +339,7 @@ WallSetup(void)
wall_num = wall[wall_num].point2)
{
SET(wall[wall_num].extra, WALLFX_LOOP_SPIN_4X);
if (wall[wall_num].nextwall >= 0)
SET(wall[wall[wall_num].nextwall].extra, WALLFX_LOOP_SPIN_4X);
}
@ -341,6 +352,7 @@ WallSetup(void)
// set first wall
SET(wp->extra, WALLFX_LOOP_REVERSE_SPIN);
if (wp->nextwall >= 0)
SET(wall[wp->nextwall].extra, WALLFX_LOOP_REVERSE_SPIN);
// move the the next wall
@ -352,6 +364,7 @@ WallSetup(void)
wall_num = wall[wall_num].point2)
{
SET(wall[wall_num].extra, WALLFX_LOOP_REVERSE_SPIN);
if (wall[wall_num].nextwall >= 0)
SET(wall[wall[wall_num].nextwall].extra, WALLFX_LOOP_REVERSE_SPIN);
}