- fixed Duke's RPG explosion

Fixes #146
This commit is contained in:
Christoph Oelckers 2020-10-24 19:44:10 +02:00
parent 28a926eb9a
commit acda4b7799
4 changed files with 13 additions and 8 deletions

View File

@ -1404,7 +1404,7 @@ void movetongue(int i, int tongue, int jaw)
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void rpgexplode(int i, int j, const vec3_t &pos, int EXPLOSION2, int newextra, int playsound) void rpgexplode(int i, int j, const vec3_t &pos, int EXPLOSION2, int EXPLOSION2BOT, int newextra, int playsound)
{ {
auto act = &hittype[i]; auto act = &hittype[i];
auto s = &act->s; auto s = &act->s;
@ -1418,8 +1418,13 @@ void rpgexplode(int i, int j, const vec3_t &pos, int EXPLOSION2, int newextra, i
} }
else if ((j & kHitTypeMask) == kHitSector) else if ((j & kHitTypeMask) == kHitSector)
{ {
k->s.cstat |= 8; if (s->zvel > 0 && EXPLOSION2BOT >= 0)
k->s.z += (48 << 8); fi.spawn(i, EXPLOSION2BOT);
else
{
k->s.cstat |= 8;
k->s.z += (48 << 8);
}
} }
if (newextra > 0) s->extra = newextra; if (newextra > 0) s->extra = newextra;
S_PlayActorSound(playsound, i); S_PlayActorSound(playsound, i);

View File

@ -1944,7 +1944,7 @@ static void weaponcommon_d(int i)
if (s->picnum == RPG) if (s->picnum == RPG)
{ {
// j is only needed for the hit type mask. // j is only needed for the hit type mask.
rpgexplode(i, j, oldpos, EXPLOSION2, -1, RPG_EXPLODE); rpgexplode(i, j, oldpos, EXPLOSION2, EXPLOSION2BOT, -1, RPG_EXPLODE);
} }
else if (s->picnum == SHRINKSPARK) else if (s->picnum == SHRINKSPARK)
{ {

View File

@ -1528,9 +1528,9 @@ static void weaponcommon_r(int i)
if (s->picnum != SPIT) if (s->picnum != SPIT)
{ {
if (s->picnum == RPG) rpgexplode(i, j, oldpos, EXPLOSION2, -1, RPG_EXPLODE); if (s->picnum == RPG) rpgexplode(i, j, oldpos, EXPLOSION2, -1, -1, RPG_EXPLODE);
else if (isRRRA() && s->picnum == RPG2) rpgexplode(i, j, oldpos, EXPLOSION2, 150, 247); else if (isRRRA() && s->picnum == RPG2) rpgexplode(i, j, oldpos, EXPLOSION2, -1, 150, 247);
else if (isRRRA() && s->picnum == RRTILE1790) rpgexplode(i, j, oldpos, EXPLOSION2, 160, RPG_EXPLODE); else if (isRRRA() && s->picnum == RRTILE1790) rpgexplode(i, j, oldpos, EXPLOSION2, -1, 160, RPG_EXPLODE);
else if (s->picnum != FREEZEBLAST && s->picnum != FIRELASER && s->picnum != SHRINKSPARK) else if (s->picnum != FREEZEBLAST && s->picnum != FIRELASER && s->picnum != SHRINKSPARK)
{ {
k = fi.spawn(i, 1441); k = fi.spawn(i, 1441);

View File

@ -42,7 +42,7 @@ void movetouchplate(int i, int plate);
void movecanwithsomething(int i); void movecanwithsomething(int i);
void bounce(int i); void bounce(int i);
void movetongue(int i, int tongue, int jaw); void movetongue(int i, int tongue, int jaw);
void rpgexplode(int i, int j, const vec3_t& pos, int EXPLOSION2, int newextra, int playsound); void rpgexplode(int i, int j, const vec3_t& pos, int EXPLOSION2, int EXPLOSION2BOT, int newextra, int playsound);
void moveooz(int i, int seenine, int seeninedead, int ooz, int explosion); void moveooz(int i, int seenine, int seeninedead, int ooz, int explosion);
void lotsofstuff(DDukeActor* s, int n, int spawntype); void lotsofstuff(DDukeActor* s, int n, int spawntype);
bool respawnmarker(int i, int yellow, int green); bool respawnmarker(int i, int yellow, int green);