Commit 6467e6fe authored by Richard Gobeille's avatar Richard Gobeille
Browse files

Duke3d: use array notation instead of pointer arithmetic for dereferences of actor execptr

parent f9952017
......@@ -1295,12 +1295,12 @@ static int32_t G_InitActor(int32_t i, int32_t tilenum, int32_t set_movflag_uncon
{
if (g_tile[tilenum].execPtr)
{
SH(i) = *(g_tile[tilenum].execPtr);
AC_ACTION_ID(actor[i].t_data) = *(g_tile[tilenum].execPtr+1);
AC_MOVE_ID(actor[i].t_data) = *(g_tile[tilenum].execPtr+2);
SH(i) = g_tile[tilenum].execPtr[0];
AC_ACTION_ID(actor[i].t_data) = g_tile[tilenum].execPtr[1];
AC_MOVE_ID(actor[i].t_data) = g_tile[tilenum].execPtr[2];
if (set_movflag_uncond || SHT(i) == 0) // AC_MOVFLAGS
SHT(i) = *(g_tile[tilenum].execPtr+3);
SHT(i) = g_tile[tilenum].execPtr[3];
return 1;
}
......
......@@ -2134,7 +2134,9 @@ void sv_restoreactors(actor_t * const actor)
if (index == -1)
{
OSD_Printf("couldn't find savegame label %s\n", &savegame_labels[AC_MOVE_ID(a.t_data) << 6]);
AC_MOVE_ID(a.t_data) = *(g_tile[s->picnum].execPtr + 2);
if (G_TileHasActor(s->picnum))
AC_MOVE_ID(a.t_data) = g_tile[s->picnum].execPtr[2];
}
else
AC_MOVE_ID(a.t_data) = labelcode[index];
......@@ -2148,8 +2150,10 @@ void sv_restoreactors(actor_t * const actor)
if (index == -1)
{
OSD_Printf("couldn't find savegame label %s\n", &savegame_labels[AC_ACTION_ID(a.t_data) << 6]);
if (g_tile[s->picnum].execPtr)
AC_ACTION_ID(a.t_data) = *(g_tile[s->picnum].execPtr + 1);
if (G_TileHasActor(s->picnum))
AC_ACTION_ID(a.t_data) = g_tile[s->picnum].execPtr[2];
AC_ACTION_COUNT(a.t_data) = 0;
AC_CURFRAME(a.t_data) = 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment