- position in InitZillaRail

This commit is contained in:
Christoph Oelckers 2022-08-31 21:50:49 +02:00
parent bd54c4e8e2
commit 6a9972938e
2 changed files with 6 additions and 13 deletions

View file

@ -12931,9 +12931,6 @@ int InitRail(PLAYER* pp)
int InitZillaRail(DSWActor* actor)
{
int nx, ny, nz;
int zvel;
if (SW_SHAREWARE) return false; // JBF: verify
PlaySound(DIGI_RAILFIRE, actor, v3df_dontpan|v3df_doppler);
@ -12941,22 +12938,18 @@ int InitZillaRail(DSWActor* actor)
// Make sprite shade brighter
actor->user.Vis = 128;
nx = actor->int_pos().X;
ny = actor->int_pos().Y;
nz = int_ActorZOfTop(actor);
auto pos = ActorVectOfTop(actor);
// Spawn a shot
// Inserting and setting up variables
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, &s_Rail[0][0], actor->sector(),
nx, ny, nz, actor->int_ang(), 1200);
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, &s_Rail[0][0], actor->sector(), pos, actor->spr.angle, 1200);
SetOwner(actor, actorNew);
actorNew->spr.yrepeat = 52;
actorNew->spr.xrepeat = 52;
actorNew->spr.shade = -15;
zvel = (100 * (HORIZ_MULT+17));
int zvel = (100 * (HORIZ_MULT+17));
actorNew->user.RotNum = 5;
NewStateGroup(actorNew, &sg_Rail[0]);
@ -12972,7 +12965,7 @@ int InitZillaRail(DSWActor* actor)
// initial positioning
auto oclipdist = actor->spr.clipdist;
actor->spr.clipdist = 0;
actorNew->spr.clipdist = 32L>>2;
actorNew->spr.clipdist = 32 >> 2;
actorNew->spr.angle += DAngle90;
HelpMissileLateral(actorNew, 700);
@ -12993,7 +12986,7 @@ int InitZillaRail(DSWActor* actor)
actorNew->spr.zvel = zvel >> 1;
if (WeaponAutoAim(actor, actorNew, 32, false) == -1)
{
actorNew->set_int_ang(NORM_ANGLE(actorNew->int_ang() - 4));
actorNew->spr.angle -= DAngle::fromBuild(4);
}
else
zvel = actorNew->spr.zvel; // Let autoaiming set zvel now

View file

@ -30,7 +30,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
BEGIN_SW_NS
#define NEW_ELECTRO 1
#define HORIZ_MULT 128L
#define HORIZ_MULT 128
inline int AngToSprite(DSWActor* actor, DSWActor* other)
{