mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-31 12:30:40 +00:00
- TestMissileSetPos
This commit is contained in:
parent
7f031f06ef
commit
ee8eb238d2
1 changed files with 11 additions and 13 deletions
|
@ -12395,12 +12395,10 @@ MissileSetPos(short Weapon, ANIMATORp DoWeapon, int dist)
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool TestMissileSetPos(DSWActor* actor, ANIMATORp DoWeapon, int dist, int zvel)
|
||||||
TestMissileSetPos(short Weapon, ANIMATORp DoWeapon, int dist, int zvel)
|
|
||||||
{
|
{
|
||||||
auto actor = &swActors[Weapon];
|
SPRITEp wp = &actor->s();
|
||||||
SPRITEp wp = &sprite[Weapon];
|
USERp wu = actor->u();
|
||||||
USERp wu = User[Weapon].Data();
|
|
||||||
int oldvel, oldzvel;
|
int oldvel, oldzvel;
|
||||||
int oldxc, oldyc, oldzc;
|
int oldxc, oldyc, oldzc;
|
||||||
bool retval = false;
|
bool retval = false;
|
||||||
|
@ -14710,7 +14708,7 @@ int InitRail(PLAYERp pp)
|
||||||
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(wp))
|
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(wp))
|
||||||
SET(wu->Flags, SPR_UNDERWATER);
|
SET(wu->Flags, SPR_UNDERWATER);
|
||||||
|
|
||||||
if (TestMissileSetPos(actorNew->GetSpriteIndex(), DoRailStart, 1200, zvel))
|
if (TestMissileSetPos(actorNew, DoRailStart, 1200, zvel))
|
||||||
{
|
{
|
||||||
sp->clipdist = oclipdist;
|
sp->clipdist = oclipdist;
|
||||||
KillActor(actorNew);
|
KillActor(actorNew);
|
||||||
|
@ -14793,7 +14791,7 @@ int InitZillaRail(DSWActor* actor)
|
||||||
if (SpriteInUnderwaterArea(wp))
|
if (SpriteInUnderwaterArea(wp))
|
||||||
SET(wu->Flags, SPR_UNDERWATER);
|
SET(wu->Flags, SPR_UNDERWATER);
|
||||||
|
|
||||||
if (TestMissileSetPos(actorNew->GetSpriteIndex(), DoRailStart, 1200, zvel))
|
if (TestMissileSetPos(actorNew, DoRailStart, 1200, zvel))
|
||||||
{
|
{
|
||||||
sp->clipdist = oclipdist;
|
sp->clipdist = oclipdist;
|
||||||
KillActor(actorNew);
|
KillActor(actorNew);
|
||||||
|
@ -14907,7 +14905,7 @@ int InitRocket(PLAYERp pp)
|
||||||
|
|
||||||
// cancel smoke trail
|
// cancel smoke trail
|
||||||
wu->Counter = 1;
|
wu->Counter = 1;
|
||||||
if (TestMissileSetPos(actorNew->GetSpriteIndex(), DoRocket, 1200, zvel))
|
if (TestMissileSetPos(actorNew, DoRocket, 1200, zvel))
|
||||||
{
|
{
|
||||||
sp->clipdist = oclipdist;
|
sp->clipdist = oclipdist;
|
||||||
KillActor(actorNew);
|
KillActor(actorNew);
|
||||||
|
@ -15018,7 +15016,7 @@ int InitBunnyRocket(PLAYERp pp)
|
||||||
|
|
||||||
// cancel smoke trail
|
// cancel smoke trail
|
||||||
wu->Counter = 1;
|
wu->Counter = 1;
|
||||||
if (TestMissileSetPos(actorNew->GetSpriteIndex(), DoRocket, 1200, zvel))
|
if (TestMissileSetPos(actorNew, DoRocket, 1200, zvel))
|
||||||
{
|
{
|
||||||
sp->clipdist = oclipdist;
|
sp->clipdist = oclipdist;
|
||||||
KillActor(actorNew);
|
KillActor(actorNew);
|
||||||
|
@ -15117,7 +15115,7 @@ int InitNuke(PLAYERp pp)
|
||||||
|
|
||||||
// cancel smoke trail
|
// cancel smoke trail
|
||||||
wu->Counter = 1;
|
wu->Counter = 1;
|
||||||
if (TestMissileSetPos(actorNew->GetSpriteIndex(), DoRocket, 1200, zvel))
|
if (TestMissileSetPos(actorNew, DoRocket, 1200, zvel))
|
||||||
{
|
{
|
||||||
sp->clipdist = oclipdist;
|
sp->clipdist = oclipdist;
|
||||||
KillActor(actorNew);
|
KillActor(actorNew);
|
||||||
|
@ -15204,7 +15202,7 @@ int InitEnemyNuke(DSWActor* actor)
|
||||||
|
|
||||||
// cancel smoke trail
|
// cancel smoke trail
|
||||||
wu->Counter = 1;
|
wu->Counter = 1;
|
||||||
if (TestMissileSetPos(actorNew->GetSpriteIndex(), DoRocket, 1200, zvel))
|
if (TestMissileSetPos(actorNew, DoRocket, 1200, zvel))
|
||||||
{
|
{
|
||||||
KillActor(actorNew);
|
KillActor(actorNew);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -16032,7 +16030,7 @@ int InitEnemyRail(DSWActor* actor)
|
||||||
wu->ychange = MOVEy(wp->xvel, wp->ang);
|
wu->ychange = MOVEy(wp->xvel, wp->ang);
|
||||||
wu->zchange = wp->zvel;
|
wu->zchange = wp->zvel;
|
||||||
|
|
||||||
if (TestMissileSetPos(actorNew->GetSpriteIndex(), DoRailStart, 600, wp->zvel))
|
if (TestMissileSetPos(actorNew, DoRailStart, 600, wp->zvel))
|
||||||
{
|
{
|
||||||
KillActor(actorNew);
|
KillActor(actorNew);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -18555,7 +18553,7 @@ int InitFireball(PLAYERp pp)
|
||||||
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(wp))
|
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(wp))
|
||||||
SET(wu->Flags, SPR_UNDERWATER);
|
SET(wu->Flags, SPR_UNDERWATER);
|
||||||
|
|
||||||
if (TestMissileSetPos(actorNew->GetSpriteIndex(), DoFireball, 1200, MulScale(zvel,44000, 16)))
|
if (TestMissileSetPos(actorNew, DoFireball, 1200, MulScale(zvel,44000, 16)))
|
||||||
{
|
{
|
||||||
sp->clipdist = oclipdist;
|
sp->clipdist = oclipdist;
|
||||||
KillActor(actorNew);
|
KillActor(actorNew);
|
||||||
|
|
Loading…
Reference in a new issue