- eliminated the last references to picnum in actors.cpp.

This commit is contained in:
Christoph Oelckers 2022-12-29 23:03:29 +01:00
parent 0249725ed8
commit 2d4eee4153
11 changed files with 13 additions and 21 deletions

View file

@ -189,6 +189,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),
};

View file

@ -3600,7 +3600,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;
@ -3641,7 +3641,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;
@ -3841,7 +3841,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--)

View file

@ -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);
}
//---------------------------------------------------------------------------

View file

@ -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);
}
//---------------------------------------------------------------------------
@ -1504,11 +1504,6 @@ void mamaspawn(DDukeActor *actor)
}
}
bool spawnweapondebris_r(int picnum)
{
return true;
}
//---------------------------------------------------------------------------
//
//

View file

@ -422,6 +422,8 @@ enum sflags3_t
SFLAG3_RANDOMANGLEONWATER = 0x00100000,
SFLAG3_NORANDOMANGLEWHENBLOCKED = 0x00200000,
SFLAG3_QUICKALTERANG = 0x00400000,
SFLAG3_SPAWNWEAPONDEBRIS = 0x00800000,
SFLAG3_NOJIBS = 0x01000000,
};

View file

@ -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);
@ -93,7 +91,6 @@ void SetDispatcher()
addweapon_d,
ifhitbyweapon_d,
fall_d,
spawnweapondebris_d,
move_d,
incur_damage_d,
@ -120,7 +117,6 @@ void SetDispatcher()
addweapon_r,
ifhitbyweapon_r,
fall_r,
spawnweapondebris_r,
move_r,
incur_damage_r,

View file

@ -83,7 +83,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

View file

@ -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);

View file

@ -168,6 +168,7 @@ class DukeBlimp : DukeActor
default
{
pic "BLIMP";
+SPAWNWEAPONDEBRIS;
}
override void Initialize()

View file

@ -8,6 +8,7 @@ class DukeDrone : DukeActor
+NOWATERDIP;
+FLOATING;
+QUICKALTERANG;
+NOJIBS;
falladjustz 0;
}

View file

@ -441,6 +441,7 @@ class RedneckMosquito : DukeActor
+NOWATERDIP;
+FLOATING;
+QUICKALTERANG;
+NOJIBS;
falladjustz 0;
}
override void Initialize()