diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index b724a3f31..6e7dd6374 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -36,7 +36,6 @@ This file contains parts of DukeGDX by Alexander Makarov-[M210] (m210-2007@mail. #include "ns.h" #include "global.h" -#include "zz_actors.h" #include "names_d.h" #include "serializer.h" @@ -1911,7 +1910,7 @@ void moveweapons_d(void) j = fi.spawn(i, LAVAPOOL); sprite[j].owner = sprite[i].owner; sprite[j].yvel = sprite[i].yvel; - actor[j].owner = sprite[i].owner; + hittype[j].owner = sprite[i].owner; deletesprite(i); continue; } diff --git a/source/games/duke/src/actors_lava.cpp b/source/games/duke/src/actors_lava.cpp index 56b01ed19..c9dc14872 100644 --- a/source/games/duke/src/actors_lava.cpp +++ b/source/games/duke/src/actors_lava.cpp @@ -27,7 +27,6 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms //------------------------------------------------------------------------- #include "ns.h" #include "global.h" -#include "zz_actors.h" #include "names_r.h" #include "serializer.h" diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index c2c4007e9..acdc5c7e9 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -28,7 +28,6 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms #include "ns.h" #include "global.h" -#include "zz_actors.h" #include "names_r.h" #include "mmulti.h" diff --git a/source/games/duke/src/bowling.cpp b/source/games/duke/src/bowling.cpp index f261ad127..73de3d251 100644 --- a/source/games/duke/src/bowling.cpp +++ b/source/games/duke/src/bowling.cpp @@ -28,7 +28,6 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms #include "ns.h" #include "global.h" -#include "zz_actors.h" #include "names_r.h" BEGIN_DUKE_NS diff --git a/source/games/duke/src/constants.h b/source/games/duke/src/constants.h index a7e6e7c77..c6da18927 100644 --- a/source/games/duke/src/constants.h +++ b/source/games/duke/src/constants.h @@ -496,3 +496,11 @@ enum EVENT_NUMEVENTS, EVENT_MAXEVENT = EVENT_NUMEVENTS - 1 }; + +enum +{ + MAXSLEEPDIST = 16384, + SLEEPTIME = 1536, + ZOFFSET6 = (4 << 8), + FOURSLEIGHT = (1 << 8) +}; diff --git a/source/games/duke/src/duke3d.h b/source/games/duke/src/duke3d.h index 838ccf4ec..2a01e4914 100644 --- a/source/games/duke/src/duke3d.h +++ b/source/games/duke/src/duke3d.h @@ -12,7 +12,7 @@ #include "polymost.h" #include "gamecvars.h" #include "menu/menu.h" -#include "zz_actors.h" +#include "funct.h" #include "gamecontrol.h" #include "game.h" #include "gamedef.h" @@ -26,6 +26,9 @@ #include "rts.h" #include "sounds.h" #include "soundefs.h" +#include "stats.h" + +extern glcycle_t drawtime, actortime, thinktime, gameupdatetime; BEGIN_DUKE_NS @@ -61,6 +64,65 @@ struct GameInterface : ::GameInterface bool CheatAllowed(bool printmsg) override; }; +struct Dispatcher +{ + // global stuff + void (*ShowLogo)(CompletionFunc completion); + void (*InitFonts)(); + void (*PrintPaused)(); + + // sectors_?.cpp + void (*think)(); + void (*initactorflags)(); + bool (*isadoorwall)(int dapic); + void (*animatewalls)(); + void (*operaterespawns)(int low); + void (*operateforcefields)(int s, int low); + bool (*checkhitswitch)(int snum, int w, int switchtype); + void (*activatebysector)(int sect, int j); + void (*checkhitwall)(int spr, int dawallnum, int x, int y, int z, int atwith); + void (*checkplayerhurt)(struct player_struct* p, int j); + bool (*checkhitceiling)(int sn); + void (*checkhitsprite)(int i, int sn); + void (*checksectors)(int low); + + bool (*ceilingspace)(int sectnum); + bool (*floorspace)(int sectnum); + void (*addweapon)(struct player_struct *p, int weapon); + void (*hitradius)(short i, int r, int hp1, int hp2, int hp3, int hp4); + int (*movesprite)(short spritenum, int xchange, int ychange, int zchange, unsigned int cliptype); + void (*lotsofmoney)(spritetype *s, short n); + void (*lotsofmail)(spritetype *s, short n); + void (*lotsofpaper)(spritetype *s, short n); + void (*guts)(spritetype* s, short gtype, short n, short p); + void (*gutsdir)(spritetype* s, short gtype, short n, short p); + int (*ifhitsectors)(int sectnum); + int (*ifhitbyweapon)(int sectnum); + void (*fall)(int g_i, int g_p); + bool (*spawnweapondebris)(int picnum, int dnum); + void (*respawnhitag)(spritetype* g_sp); + void (*checktimetosleep)(int g_i); + void (*move)(int g_i, int g_p, int g_x); + int (*spawn)(int j, int pn); + void (*check_fta_sounds)(int i); + + // player + void (*incur_damage)(struct player_struct* p); + void (*shoot)(int, int); + void (*selectweapon)(int snum, int j); + int (*doincrements)(struct player_struct* p); + void (*checkweapons)(struct player_struct* p); + void (*processinput)(int snum); + void (*displayweapon)(int snum); + void (*displaymasks)(int snum); + + void (*animatesprites)(int x, int y, int a, int smoothratio); + + +}; + +extern Dispatcher fi; + END_DUKE_NS #endif diff --git a/source/games/duke/src/flags_d.cpp b/source/games/duke/src/flags_d.cpp index 4ff180428..08a4fe1a7 100644 --- a/source/games/duke/src/flags_d.cpp +++ b/source/games/duke/src/flags_d.cpp @@ -34,7 +34,6 @@ source as it is released. #include "ns.h" #include "global.h" -#include "zz_actors.h" #include "names_d.h" BEGIN_DUKE_NS diff --git a/source/games/duke/src/flags_r.cpp b/source/games/duke/src/flags_r.cpp index efd37f84c..8b70ef98f 100644 --- a/source/games/duke/src/flags_r.cpp +++ b/source/games/duke/src/flags_r.cpp @@ -28,7 +28,6 @@ Prepared for public release, 03/21/2003 - Charlie Wiederhold, 3D Realms #include "ns.h" #include "global.h" -#include "zz_actors.h" #include "names_r.h" BEGIN_DUKE_NS diff --git a/source/games/duke/src/funct.h b/source/games/duke/src/funct.h index e81468c51..4833607f6 100644 --- a/source/games/duke/src/funct.h +++ b/source/games/duke/src/funct.h @@ -1,6 +1,7 @@ #pragma once #include "screenjob.h" +#include "constants.h" BEGIN_DUKE_NS @@ -153,4 +154,24 @@ void getglobalz(int s); int getincangle(int c, int n); void OnEvent(int id, int pnum = -1, int snum = -1, int dist = -1); +short EGS(short whatsect, int s_x, int s_y, int s_z, short s_pn, signed char s_s, signed char s_xr, signed char s_yr, short s_a, short s_ve, int s_zv, short s_ow, signed char s_ss); +void ceilingglass(int spriteNum, int sectNum, int glassCnt); +void spriteglass(int spriteNum, int glassCnt); +void lotsofcolourglass(int spriteNum, int wallNum, int glassCnt); +void lotsofglass(int spriteNum, int wallnum, int glassCnt); + +void addspritetodelete(int spnum); +void checkavailinven(struct player_struct* p); +int initspriteforspawn(int j, int pn, const std::initializer_list &excludes); +void spawninitdefault(int j, int i); +void spawntransporter(int j, int i, bool beam); +int spawnbloodpoolpart1(int j, int i); +void initfootprint(int j, int i); +void initshell(int j, int i, bool isshell); +void initcrane(int j, int i, int CRANEPOLE); +void initwaterdrip(int j, int i); +int initreactor(int j, int i, bool isrecon); +void spawneffector(int i); +void gameexitfrommenu(); + END_DUKE_NS diff --git a/source/games/duke/src/game.h b/source/games/duke/src/game.h index d75a90e19..91871fbcc 100644 --- a/source/games/duke/src/game.h +++ b/source/games/duke/src/game.h @@ -37,6 +37,28 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_DUKE_NS +struct weaponhit +{ + uint8_t cgg; + short picnum, ang, extra, owner, movflag; + short tempang, actorstayput, dispicnum; + short timetosleep; + int floorz, ceilingz, lastvx, lastvy, bposx, bposy, bposz, aflags; + int temp_data[6]; +}; + + +// Todo - put more state in here +struct ActorInfo +{ + uint32_t scriptaddress; + uint32_t flags; + int aimoffset; +}; + + + + #define MAXSAVEGAMENAMESTRUCT 32 #define MAXSAVEGAMENAME (MAXSAVEGAMENAMESTRUCT-1) #define MAXPWLOCKOUT 128 @@ -129,7 +151,6 @@ extern int32_t tempwallptr; //extern int8_t cheatbuf[MAXCHEATLEN],cheatbuflen; -short EGS(short whatsect, int s_x, int s_y, int s_z, short s_pn, signed char s_s, signed char s_xr, signed char s_yr, short s_a, short s_ve, int s_zv, short s_ow, signed char s_ss); #define A_InsertSprite EGS int G_DoMoveThings(void); //int32_t G_EndOfLevel(void); @@ -140,10 +161,6 @@ void Yax_SetBunchZs(int32_t sectnum, int32_t cf, int32_t daz); #define Yax_SetBunchZs(sectnum, cf, daz) #endif -void ceilingglass(int spriteNum,int sectNum,int glassCnt); -void spriteglass(int spriteNum,int glassCnt); -void lotsofcolourglass(int spriteNum,int wallNum,int glassCnt); -void lotsofglass(int spriteNum,int wallnum,int glassCnt); void G_BackToMenu(void); @@ -198,42 +215,6 @@ struct TileInfo }; extern TileInfo tileinfo[MAXTILES]; -inline int actorflag(int spritenum, int mask) -{ - return (((actorinfo[sprite[spritenum].picnum].flags/* ^ actor[spritenum].flags*/) & mask) != 0); -} - -inline int actorfella(int spnum) -{ - return actorflag(spnum, SFLAG_KILLCOUNT); -} - -inline void setflag(int flag, const std::initializer_list& types) -{ - for (auto val : types) - { - actorinfo[val].flags |= flag; - } -} - -inline bool inventory(spritetype* S) -{ - return !!(actorinfo[S->picnum].flags & SFLAG_INVENTORY); -} - - -inline void settileflag(int flag, const std::initializer_list& types) -{ - for (auto val : types) - { - tileinfo[val].flags |= flag; - } -} - -inline bool wallswitchcheck(int s) -{ - return !!(tileinfo[s].flags & TFLAG_WALLSWITCH); -} // (unsigned)iPicnum check: AMC TC Rusty Nails, bayonet MG alt. fire, iPicnum == -1 (via aplWeaponShoots) #define A_CheckSpriteTileFlags(iPicnum, iType) (((unsigned)iPicnum < MAXTILES) && (actorinfo[iPicnum].flags & iType) != 0) @@ -270,20 +251,6 @@ static inline void G_NewGame_EnterLevel(void) extern void G_PrintCurrentMusic(void); -void addspritetodelete(int spnum); -void checkavailinven(struct player_struct* p); - -int initspriteforspawn(int j, int pn, const std::initializer_list &excludes); -void spawninitdefault(int j, int i); -void spawntransporter(int j, int i, bool beam); -int spawnbloodpoolpart1(int j, int i); -void initfootprint(int j, int i); -void initshell(int j, int i, bool isshell); -void initcrane(int j, int i, int CRANEPOLE); -void initwaterdrip(int j, int i); -int initreactor(int j, int i, bool isrecon); -void spawneffector(int i); -void gameexitfrommenu(); extern void G_InitMultiPsky(int CLOUDYOCEAN__DYN, int MOONSKY1__DYN, int BIGORBIT1__DYN, int LA__DYN); extern void G_SetupGlobalPsky(void); @@ -292,65 +259,12 @@ extern void G_SetupGlobalPsky(void); extern void genspriteremaps(void); - -struct Dispatcher -{ - // global stuff - void (*ShowLogo)(CompletionFunc completion); - void (*InitFonts)(); - void (*PrintPaused)(); - - // sectors_?.cpp - void (*think)(); - void (*initactorflags)(); - bool (*isadoorwall)(int dapic); - void (*animatewalls)(); - void (*operaterespawns)(int low); - void (*operateforcefields)(int s, int low); - bool (*checkhitswitch)(int snum, int w, int switchtype); - void (*activatebysector)(int sect, int j); - void (*checkhitwall)(int spr, int dawallnum, int x, int y, int z, int atwith); - void (*checkplayerhurt)(struct player_struct* p, int j); - bool (*checkhitceiling)(int sn); - void (*checkhitsprite)(int i, int sn); - void (*checksectors)(int low); - - bool (*ceilingspace)(int sectnum); - bool (*floorspace)(int sectnum); - void (*addweapon)(struct player_struct *p, int weapon); - void (*hitradius)(short i, int r, int hp1, int hp2, int hp3, int hp4); - int (*movesprite)(short spritenum, int xchange, int ychange, int zchange, unsigned int cliptype); - void (*lotsofmoney)(spritetype *s, short n); - void (*lotsofmail)(spritetype *s, short n); - void (*lotsofpaper)(spritetype *s, short n); - void (*guts)(spritetype* s, short gtype, short n, short p); - void (*gutsdir)(spritetype* s, short gtype, short n, short p); - int (*ifhitsectors)(int sectnum); - int (*ifhitbyweapon)(int sectnum); - void (*fall)(int g_i, int g_p); - bool (*spawnweapondebris)(int picnum, int dnum); - void (*respawnhitag)(spritetype* g_sp); - void (*checktimetosleep)(int g_i); - void (*move)(int g_i, int g_p, int g_x); - int (*spawn)(int j, int pn); - void (*check_fta_sounds)(int i); - - // player - void (*incur_damage)(struct player_struct* p); - void (*shoot)(int, int); - void (*selectweapon)(int snum, int j); - int (*doincrements)(struct player_struct* p); - void (*checkweapons)(struct player_struct* p); - void (*processinput)(int snum); - void (*displayweapon)(int snum); - void (*displaymasks)(int snum); - - void (*animatesprites)(int x, int y, int a, int smoothratio); +extern int32_t actor_tog; +extern int32_t otherp; -}; - -extern Dispatcher fi; +extern ActorInfo actorinfo[MAXTILES]; +extern weaponhit hittype[MAXSPRITES]; #endif diff --git a/source/games/duke/src/gamedef.h b/source/games/duke/src/gamedef.h index 80733b27b..8c6878b55 100644 --- a/source/games/duke/src/gamedef.h +++ b/source/games/duke/src/gamedef.h @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define gamedef_h_ #include "gamevar.h" -#include "zz_actors.h" +#include "funct.h" #include "build.h" // hashtable_t #include "common.h" // tokenlist #include "player.h" // projectile_t diff --git a/source/games/duke/src/gamevar.h b/source/games/duke/src/gamevar.h index 6ca2a6cbb..826e2051d 100644 --- a/source/games/duke/src/gamevar.h +++ b/source/games/duke/src/gamevar.h @@ -1,5 +1,7 @@ #pragma once +#include "names.h" + BEGIN_DUKE_NS // gamedef.c diff --git a/source/games/duke/src/global.h b/source/games/duke/src/global.h index cc965f3d3..5923fa448 100644 --- a/source/games/duke/src/global.h +++ b/source/games/duke/src/global.h @@ -76,10 +76,6 @@ enum DUKE3D_GLOBALFLAGS { DUKE3D_NO_PALETTE_CHANGES = 1<<2, }; -G_EXTERN actor_t actor[MAXSPRITES]; -// actorinfo: tile-specific data THAT DOES NOT CHANGE during the course of a game -G_EXTERN ActorInfo actorinfo[MAXTILES]; - struct animwalltype { int16_t wallnum, tag; @@ -245,7 +241,6 @@ G_EXTERN playerspawn_t g_playerSpawnPoints[MAXPLAYERS]; #define po g_playerSpawnPoints #pragma pack(pop) -G_EXTERN int32_t g_noEnemies; G_EXTERN int32_t restorepalette; G_EXTERN uint32_t everyothertime; G_EXTERN uint32_t g_moveThingsCount; diff --git a/source/games/duke/src/inlines.h b/source/games/duke/src/inlines.h index 79b23d3ee..30769891f 100644 --- a/source/games/duke/src/inlines.h +++ b/source/games/duke/src/inlines.h @@ -5,6 +5,10 @@ // all inline functions. BEGIN_DUKE_NS +inline bool AFLAMABLE(int X) +{ + return (X == TILE_BOX || X == TILE_TREE1 || X == TILE_TREE2 || X == TILE_TIRE || X == TILE_CONE); +} inline int badguypic(int const tileNum) { @@ -16,6 +20,42 @@ inline int badguy(void const * const pSprite) return badguypic(((uspritetype const *) pSprite)->picnum); } +inline int actorflag(int spritenum, int mask) +{ + return (((actorinfo[sprite[spritenum].picnum].flags/* ^ hittype[spritenum].flags*/) & mask) != 0); +} + +inline int actorfella(int spnum) +{ + return actorflag(spnum, SFLAG_KILLCOUNT); +} + +inline void setflag(int flag, const std::initializer_list& types) +{ + for (auto val : types) + { + actorinfo[val].flags |= flag; + } +} + +inline bool inventory(spritetype* S) +{ + return !!(actorinfo[S->picnum].flags & SFLAG_INVENTORY); +} + +inline void settileflag(int flag, const std::initializer_list& types) +{ + for (auto val : types) + { + tileinfo[val].flags |= flag; + } +} + +inline bool wallswitchcheck(int s) +{ + return !!(tileinfo[s].flags & TFLAG_WALLSWITCH); +} + inline int checkcursectnums(int se) { int i; diff --git a/source/games/duke/src/macros.h b/source/games/duke/src/macros.h index 44e7697ab..062575175 100644 --- a/source/games/duke/src/macros.h +++ b/source/games/duke/src/macros.h @@ -50,11 +50,6 @@ static FORCE_INLINE int32_t krand2(void) #define BIT(shift) (1u<<(shift)) -inline bool AFLAMABLE(int X) -{ - return (X == TILE_BOX || X == TILE_TREE1 || X == TILE_TREE2 || X == TILE_TIRE || X == TILE_CONE); -} - #define rnd(X) ((krand2()>>8)>=(255-(X))) // diff --git a/source/games/duke/src/sounds.cpp b/source/games/duke/src/sounds.cpp index 771843c0b..4b53624b8 100644 --- a/source/games/duke/src/sounds.cpp +++ b/source/games/duke/src/sounds.cpp @@ -509,7 +509,7 @@ void S_StopEnvSound(int sndNum, int sprNum, int channel) // StopSound kills the actor reference so this cannot be delayed until ChannelEnded gets called. At that point the actor may also not be valid anymore. if (S_IsAmbientSFX(sprNum) && sector[sprite[sprNum].sectnum].lotag < 3) // ST_2_UNDERWATER - actor[sprNum].temp_data[0] = 0; + hittype[sprNum].temp_data[0] = 0; } } diff --git a/source/games/duke/src/zz_actors.h b/source/games/duke/src/zz_actors.h deleted file mode 100644 index cd67bc3cb..000000000 --- a/source/games/duke/src/zz_actors.h +++ /dev/null @@ -1,121 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010 EDuke32 developers and contributors - -This file is part of EDuke32. - -EDuke32 is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#ifndef actors_h_ -#define actors_h_ - -#include "player.h" -# include "names.h" -#include "stats.h" - -extern glcycle_t drawtime, actortime, thinktime, gameupdatetime; - -BEGIN_DUKE_NS - -#define MAXSLEEPDIST 16384 -#define SLEEPTIME 1536 -#define ZOFFSET (1<<8) -#define ZOFFSET2 (16<<8) -#define ZOFFSET3 (8<<8) -#define ZOFFSET4 (12<<8) -#define ZOFFSET5 (32<<8) -#define ZOFFSET6 (4<<8) -#define FOURSLEIGHT ZOFFSET - -#define ACTOR_MAXFALLINGZVEL 6144 -#define ACTOR_ONWATER_ADDZ (24<<8) - - - -// Defines for 'useractor' keyword -enum uactortypes_t -{ - notenemy, - enemy, - enemystayput -}; - -enum actionparams -{ - ACTION_STARTFRAME = 0, - ACTION_NUMFRAMES, - ACTION_VIEWTYPE, - ACTION_INCVAL, - ACTION_DELAY, - ACTION_FLAGS, - ACTION_PARAM_COUNT, -}; - -// (+ 40 16 16 4 8 6 8 6 4 20) -typedef struct -{ - int32_t temp_data[10]; // 40b sometimes used to hold offsets to con code - - int32_t aflags; // 4b - union - { - vec3_t bpos; // 12b - struct { int bposx, bposy, bposz; }; - }; - int32_t floorz, ceilingz; // 8b - union - { - vec2_t lastv; // 8b - struct { int lastvx, lastvy; }; - }; - int16_t picnum, ang, extra, owner; // 8b - int16_t movflag, tempang, timetosleep; // 6b - int16_t actorstayput; // 2b - - uint8_t cgg, lasttransport; // 2b - // NOTE: 'dispicnum' is updated every frame, not in sync with game tics! - int16_t dispicnum; // 2b - -} actor_t; - - -// Todo - put more state in here -struct ActorInfo -{ - uint32_t scriptaddress; - uint32_t flags; - int aimoffset; -}; - - -// KEEPINSYNC lunatic/con_lang.lua - - -extern ActorInfo actorinfo[MAXTILES]; -extern actor_t actor[MAXSPRITES]; -extern actor_t* hittype; -extern int32_t g_noEnemies; -#define actor_tog g_noEnemies -extern int32_t otherp; -extern int g_canSeePlayer; - - - -END_DUKE_NS -#include "funct.h" - -#endif diff --git a/source/games/duke/src/zz_game.cpp b/source/games/duke/src/zz_game.cpp index 130ac5934..24b81674b 100644 --- a/source/games/duke/src/zz_game.cpp +++ b/source/games/duke/src/zz_game.cpp @@ -72,8 +72,11 @@ char boardfilename[BMAX_PATH] = {0}; int32_t g_Shareware = 0; int32_t tempwallptr; +int32_t actor_tog; static int32_t nonsharedtimer; +weaponhit hittype[MAXSPRITES]; +ActorInfo actorinfo[MAXTILES]; static void gameTimerHandler(void) { @@ -524,8 +527,8 @@ void G_MaybeAllocPlayer(int32_t pnum) void app_loop(); -// TODO: reorder (net)actor_t to eliminate slop and update assertion -EDUKE32_STATIC_ASSERT(sizeof(actor_t)%4 == 0); +// TODO: reorder (net)weaponhit to eliminate slop and update assertion +EDUKE32_STATIC_ASSERT(sizeof(weaponhit)%4 == 0); static const char* actions[] = { "Move_Forward", @@ -906,7 +909,6 @@ void GameInterface::FreeGameData() // access wrappers that alias old names to current data. psaccess ps; -actor_t* hittype = actor; END_DUKE_NS diff --git a/source/games/duke/src/zz_premap.cpp b/source/games/duke/src/zz_premap.cpp index 6b8283780..fa63cd116 100644 --- a/source/games/duke/src/zz_premap.cpp +++ b/source/games/duke/src/zz_premap.cpp @@ -181,7 +181,7 @@ void G_ResetTimers(uint8_t keepgtics) g_moveThingsCount = 0; if (camsprite >= 0) - actor[camsprite].temp_data[0] = 0; + hittype[camsprite].temp_data[0] = 0; } int G_FindLevelByFile(const char *fileName) diff --git a/source/games/duke/src/zz_savegame.cpp b/source/games/duke/src/zz_savegame.cpp index b20dff86d..838421100 100644 --- a/source/games/duke/src/zz_savegame.cpp +++ b/source/games/duke/src/zz_savegame.cpp @@ -826,7 +826,7 @@ static char svgm_script_string [] = "blK:scri"; static const dataspec_t svgm_script[] = { { DS_STRING, (void *)svgm_script_string, 0, 1 }, - { 0, &actor[0], sizeof(actor_t), MAXSPRITES }, + { 0, &hittype[0], sizeof(weaponhit), MAXSPRITES }, { DS_SAVEFN|DS_LOADFN, (void *)&sv_postactordata, 0, 1 }, { DS_END, 0, 0, 0 } };