- 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 s = &act->s;
@ -1417,10 +1417,15 @@ void rpgexplode(int i, int j, const vec3_t &pos, int EXPLOSION2, int newextra, i
k->s.yrepeat = 6;
}
else if ((j & kHitTypeMask) == kHitSector)
{
if (s->zvel > 0 && EXPLOSION2BOT >= 0)
fi.spawn(i, EXPLOSION2BOT);
else
{
k->s.cstat |= 8;
k->s.z += (48 << 8);
}
}
if (newextra > 0) s->extra = newextra;
S_PlayActorSound(playsound, i);

View file

@ -1944,7 +1944,7 @@ static void weaponcommon_d(int i)
if (s->picnum == RPG)
{
// 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)
{

View file

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

View file

@ -42,7 +42,7 @@ void movetouchplate(int i, int plate);
void movecanwithsomething(int i);
void bounce(int i);
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 lotsofstuff(DDukeActor* s, int n, int spawntype);
bool respawnmarker(int i, int yellow, int green);