Skip to content

Commit

Permalink
- eliminated the last references to picnum in actors.cpp.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Mar 27, 2023
1 parent 6d9a225 commit e36339f
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 21 deletions.
2 changes: 2 additions & 0 deletions source/core/thingdef_data.cpp
Expand Up @@ -188,6 +188,8 @@ static FFlagDef DukeActorFlagDefs[] =
DEFINE_FLAG(SFLAG3, RANDOMANGLEONWATER, DDukeActor, flags3),
DEFINE_FLAG(SFLAG3, NORANDOMANGLEWHENBLOCKED, DDukeActor, flags3),
DEFINE_FLAG(SFLAG3, QUICKALTERANG, DDukeActor, flags3),
DEFINE_FLAG(SFLAG3, SPAWNWEAPONDEBRIS, DDukeActor, flags3),
DEFINE_FLAG(SFLAG3, NOJIBS, DDukeActor, flags3),

};

Expand Down
6 changes: 3 additions & 3 deletions source/games/duke/src/actors.cpp
Expand Up @@ -3605,7 +3605,7 @@ void alterang(int ang, DDukeActor* actor, int playernum)
//
//---------------------------------------------------------------------------

void fall_common(DDukeActor *actor, int playernum, int DRONE, int(*fallspecial)(DDukeActor*, int))
void fall_common(DDukeActor *actor, int playernum, int(*fallspecial)(DDukeActor*, int))
{
actor->spr.xoffset = 0;
actor->spr.yoffset = 0;
Expand Down Expand Up @@ -3646,7 +3646,7 @@ void fall_common(DDukeActor *actor, int playernum, int DRONE, int(*fallspecial)(

if (actor->vel.Z > (3084/256.) && actor->spr.extra <= 1)
{
if (actor->spr.pal != 1 && actor->spr.picnum != DRONE)
if (actor->spr.pal != 1 && !(actor->flags3 & SFLAG3_NOJIBS))
{
if (actor->isPlayer() && actor->spr.extra > 0)
goto SKIPJIBS;
Expand Down Expand Up @@ -3846,7 +3846,7 @@ void actorsizeto(DDukeActor* actor, double x, double y)
void spawndebris(DDukeActor* g_ac, int dnum, int count)
{
if (dnum < 0 || dnum >= ScrapMax) return; // this code only works with scrap and nothing else.
bool weap = fi.spawnweapondebris(g_ac->spr.picnum);
bool weap = (g_ac->flags3 & SFLAG3_SPAWNWEAPONDEBRIS);

if (g_ac->insector())
for (int j = count; j >= 0; j--)
Expand Down
7 changes: 1 addition & 6 deletions source/games/duke/src/actors_d.cpp
Expand Up @@ -1067,12 +1067,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel)

void fall_d(DDukeActor *actor, int g_p)
{
fall_common(actor, g_p, DTILE_DRONE, nullptr);
}

bool spawnweapondebris_d(int picnum)
{
return picnum == DTILE_BLIMP;
fall_common(actor, g_p, nullptr);
}

//---------------------------------------------------------------------------
Expand Down
7 changes: 1 addition & 6 deletions source/games/duke/src/actors_r.cpp
Expand Up @@ -1381,7 +1381,7 @@ static int fallspecial(DDukeActor *actor, int playernum)

void fall_r(DDukeActor* ac, int g_p)
{
fall_common(ac, g_p, RTILE_DRONE, fallspecial);
fall_common(ac, g_p, fallspecial);
}

//---------------------------------------------------------------------------
Expand Down Expand Up @@ -1504,11 +1504,6 @@ void mamaspawn(DDukeActor *actor)
}
}

bool spawnweapondebris_r(int picnum)
{
return true;
}

//---------------------------------------------------------------------------
//
//
Expand Down
2 changes: 2 additions & 0 deletions source/games/duke/src/constants.h
Expand Up @@ -421,6 +421,8 @@ enum sflags3_t
SFLAG3_RANDOMANGLEONWATER = 0x00080000,
SFLAG3_NORANDOMANGLEWHENBLOCKED = 0x00100000,
SFLAG3_QUICKALTERANG = 0x00200000,
SFLAG3_SPAWNWEAPONDEBRIS = 0x00400000,
SFLAG3_NOJIBS = 0x00800000,


};
Expand Down
4 changes: 0 additions & 4 deletions source/games/duke/src/dispatch.cpp
Expand Up @@ -50,8 +50,6 @@ int ifhitbyweapon_r(DDukeActor* sn);
int ifhitbyweapon_d(DDukeActor* sn);
void fall_d(DDukeActor* i, int g_p);
void fall_r(DDukeActor* i, int g_p);
bool spawnweapondebris_d(int picnum);
bool spawnweapondebris_r(int picnum);
void move_d(DDukeActor* i, int g_p, int g_x);
void move_r(DDukeActor* i, int g_p, int g_x);
void incur_damage_d(player_struct* p);
Expand Down Expand Up @@ -93,7 +91,6 @@ void SetDispatcher()
addweapon_d,
ifhitbyweapon_d,
fall_d,
spawnweapondebris_d,
move_d,

incur_damage_d,
Expand All @@ -120,7 +117,6 @@ void SetDispatcher()
addweapon_r,
ifhitbyweapon_r,
fall_r,
spawnweapondebris_r,
move_r,

incur_damage_r,
Expand Down
1 change: 0 additions & 1 deletion source/games/duke/src/duke3d.h
Expand Up @@ -84,7 +84,6 @@ struct Dispatcher
void (*addweapon)(player_struct *p, int weapon, bool wswitch);
int (*ifhitbyweapon)(DDukeActor* sectnum);
void (*fall)(DDukeActor* actor, int g_p);
bool (*spawnweapondebris)(int picnum);
void (*move)(DDukeActor* i, int g_p, int g_x);

// player
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/funct.h
Expand Up @@ -85,7 +85,7 @@ void handle_se130(DDukeActor* i, int countmax);

int dodge(DDukeActor*);
void alterang(int ang, DDukeActor* actor, int g_p);
void fall_common(DDukeActor* actor, int g_p, int DRONE, int(*fallspecial)(DDukeActor*, int));
void fall_common(DDukeActor* actor, int g_p, int(*fallspecial)(DDukeActor*, int));
void checkavailweapon(player_struct* p);
void addammo(int weapon, player_struct* p, int amount);

Expand Down
1 change: 1 addition & 0 deletions wadsrc/static/zscript/games/duke/actors/mech.zs
Expand Up @@ -8,6 +8,7 @@ class DukeDrone : DukeActor
+NOWATERDIP;
+FLOATING;
+QUICKALTERANG;
+NOJIBS;
falladjustz 0;
}

Expand Down
1 change: 1 addition & 0 deletions wadsrc/static/zscript/games/duke/actors/redneckenemies.zs
Expand Up @@ -441,6 +441,7 @@ class RedneckMosquito : DukeActor
+NOWATERDIP;
+FLOATING;
+QUICKALTERANG;
+NOJIBS;
falladjustz 0;
}
override void Initialize()
Expand Down

0 comments on commit e36339f

Please sign in to comment.