- SpawnBigGunFlames

This commit is contained in:
Christoph Oelckers 2021-11-05 00:22:03 +01:00
parent 120a14a9a7
commit a40fca5398
3 changed files with 11 additions and 18 deletions

View file

@ -196,7 +196,7 @@ void CopySectorMatch(short match)
// find and add sprite to SO // find and add sprite to SO
sop = DetectSectorObject(&sector[sp->sectnum]); sop = DetectSectorObject(&sector[sp->sectnum]);
AddSpriteToSectorObject(itActor->GetSpriteIndex(), sop); AddSpriteToSectorObject(itActor, sop);
// update sprites postions so they aren't in the // update sprites postions so they aren't in the
// wrong place for one frame // wrong place for one frame

View file

@ -11232,10 +11232,8 @@ SpawnMicroExp(int16_t Weapon)
return explosion; return explosion;
} }
int void AddSpriteToSectorObject(DSWActor* actor, SECTOR_OBJECTp sop)
AddSpriteToSectorObject(short SpriteNum, SECTOR_OBJECTp sop)
{ {
auto actor = &swActors[SpriteNum];
SPRITEp sp = &actor->s(); SPRITEp sp = &actor->s();
USERp u = actor->u(); USERp u = actor->u();
unsigned sn; unsigned sn;
@ -11253,7 +11251,7 @@ AddSpriteToSectorObject(short SpriteNum, SECTOR_OBJECTp sop)
break; break;
} }
if (sn >= SIZ(sop->so_actors) - 1) return 0; if (sn >= SIZ(sop->so_actors) - 1) return;
sop->so_actors[sn] = actor; sop->so_actors[sn] = actor;
so_setspriteinterpolation(sop, actor); so_setspriteinterpolation(sop, actor);
@ -11264,11 +11262,9 @@ AddSpriteToSectorObject(short SpriteNum, SECTOR_OBJECTp sop)
u->sz = sector[sop->mid_sector].floorz - sp->z; u->sz = sector[sop->mid_sector].floorz - sp->z;
u->sang = sp->ang; u->sang = sp->ang;
return 0;
} }
int void SpawnBigGunFlames(DSWActor* actor, DSWActor* Operator, SECTOR_OBJECTp sop, bool smallflames)
SpawnBigGunFlames(int16_t Weapon, int16_t Operator, SECTOR_OBJECTp sop, bool smallflames)
{ {
SPRITEp sp; SPRITEp sp;
USERp u; USERp u;
@ -11276,8 +11272,8 @@ SpawnBigGunFlames(int16_t Weapon, int16_t Operator, SECTOR_OBJECTp sop, bool sma
USERp eu; USERp eu;
unsigned sn; unsigned sn;
sp = &sprite[Weapon]; sp = &actor->s();
u = User[Weapon].Data(); u = actor->u();
auto expActor = SpawnActor(STAT_MISSILE, MICRO_EXP, s_BigGunFlame, sp->sectnum, auto expActor = SpawnActor(STAT_MISSILE, MICRO_EXP, s_BigGunFlame, sp->sectnum,
sp->x, sp->y, sp->z, sp->ang, 0); sp->x, sp->y, sp->z, sp->ang, 0);
@ -11285,7 +11281,7 @@ SpawnBigGunFlames(int16_t Weapon, int16_t Operator, SECTOR_OBJECTp sop, bool sma
eu = expActor->u(); eu = expActor->u();
exp->hitag = LUMINOUS; //Always full brightness exp->hitag = LUMINOUS; //Always full brightness
SetOwner(&swActors[Operator], expActor); SetOwner(Operator, expActor);
exp->shade = -40; exp->shade = -40;
if (smallflames) if (smallflames)
{ {
@ -11312,7 +11308,7 @@ SpawnBigGunFlames(int16_t Weapon, int16_t Operator, SECTOR_OBJECTp sop, bool sma
break; break;
} }
if (sn >= SIZ(sop->so_actors) - 1) return -1; if (sn >= SIZ(sop->so_actors) - 1) return;
sop->so_actors[sn] = expActor; sop->so_actors[sn] = expActor;
so_setspriteinterpolation(sop, expActor); so_setspriteinterpolation(sop, expActor);
@ -11335,8 +11331,6 @@ SpawnBigGunFlames(int16_t Weapon, int16_t Operator, SECTOR_OBJECTp sop, bool sma
eu->sx = u->sx; eu->sx = u->sx;
eu->sy = u->sy; eu->sy = u->sy;
eu->sz = u->sz; eu->sz = u->sz;
return expActor->GetSpriteIndex();
} }
void SpawnGrenadeSecondaryExp(DSWActor* actor, int ang) void SpawnGrenadeSecondaryExp(DSWActor* actor, int ang)
@ -11347,7 +11341,6 @@ void SpawnGrenadeSecondaryExp(DSWActor* actor, int ang)
USERp eu; USERp eu;
int vel; int vel;
ASSERT(u); ASSERT(u);
auto expActor = SpawnActor(STAT_MISSILE, GRENADE_EXP, s_GrenadeSmallExp, sp->sectnum, auto expActor = SpawnActor(STAT_MISSILE, GRENADE_EXP, s_GrenadeSmallExp, sp->sectnum,
sp->x, sp->y, sp->z, sp->ang, 1024); sp->x, sp->y, sp->z, sp->ang, 1024);
@ -17450,7 +17443,7 @@ int InitSobjGun(PLAYERp pp)
case 32: case 32:
case 0: case 0:
SpawnVis(actor, -1, -1, -1, -1, 8); SpawnVis(actor, -1, -1, -1, -1, 8);
SpawnBigGunFlames(actor->GetSpriteIndex(), pp->PlayerSprite, pp->sop, false); SpawnBigGunFlames(actor, pp->Actor(), pp->sop, false);
SetGunQuake(actor->GetSpriteIndex()); SetGunQuake(actor->GetSpriteIndex());
InitTankShell(actor, pp); InitTankShell(actor, pp);
if (!SP_TAG5(sp)) if (!SP_TAG5(sp))
@ -17460,7 +17453,7 @@ int InitSobjGun(PLAYERp pp)
break; break;
case 1: case 1:
SpawnVis(actor, -1, -1, -1, -1, 32); SpawnVis(actor, -1, -1, -1, -1, 32);
SpawnBigGunFlames(actor->GetSpriteIndex(), pp->PlayerSprite, pp->sop, true); SpawnBigGunFlames(actor, pp->Actor(), pp->sop, true);
InitSobjMachineGun(actor, pp); InitSobjMachineGun(actor, pp);
if (!SP_TAG5(sp)) if (!SP_TAG5(sp))
pp->FirePause = 10; pp->FirePause = 10;

View file

@ -231,7 +231,7 @@ int DoFindGround(DSWActor*);
int DoFindGroundPoint(DSWActor* actor); int DoFindGroundPoint(DSWActor* actor);
void SpriteQueueDelete(DSWActor* actor); void SpriteQueueDelete(DSWActor* actor);
int HelpMissileLateral(DSWActor*, int dist); int HelpMissileLateral(DSWActor*, int dist);
int AddSpriteToSectorObject(short SpriteNum,SECTOR_OBJECTp sop); void AddSpriteToSectorObject(DSWActor*,SECTOR_OBJECTp sop);
void QueueReset(void); void QueueReset(void);
int PlayerCheckDeath(PLAYERp pp,short Weapon); int PlayerCheckDeath(PLAYERp pp,short Weapon);
bool SpriteWarpToUnderwater(DSWActor* actor); bool SpriteWarpToUnderwater(DSWActor* actor);