- remaining s() in bullet.cpp, grenade.cpp and gun.cpp.

This commit is contained in:
Christoph Oelckers 2021-12-23 18:11:53 +01:00
parent cd6bb5305e
commit 7eaf669295
3 changed files with 114 additions and 130 deletions

View file

@ -186,8 +186,7 @@ void BulletHitsSprite(Bullet *pBullet, DExhumedActor* pBulletActor, DExhumedActo
bulletInfo *pBulletInfo = &BulletInfo[pBullet->nType];
auto pHitSprite = &pHitActor->s();
int nStat = pHitSprite->statnum;
int nStat = pHitActor->spr.statnum;
switch (pBullet->nType)
{
@ -197,9 +196,9 @@ void BulletHitsSprite(Bullet *pBullet, DExhumedActor* pBulletActor, DExhumedActo
return;
}
pHitSprite->hitag++;
pHitActor->spr.hitag++;
if (pHitSprite->hitag == 15) {
if (pHitActor->spr.hitag == 15) {
IgniteSprite(pHitActor);
}
@ -237,22 +236,22 @@ void BulletHitsSprite(Bullet *pBullet, DExhumedActor* pBulletActor, DExhumedActo
{
int nAngle = (pActor->spr.ang + 256) - RandomSize(9);
pHitSprite->xvel = bcos(nAngle, 1);
pHitSprite->yvel = bsin(nAngle, 1);
pHitSprite->zvel = (-(RandomSize(3) + 1)) << 8;
pHitActor->spr.xvel = bcos(nAngle, 1);
pHitActor->spr.yvel = bsin(nAngle, 1);
pHitActor->spr.zvel = (-(RandomSize(3) + 1)) << 8;
}
else
{
int xVel = pHitSprite->xvel;
int yVel = pHitSprite->yvel;
int xVel = pHitActor->spr.xvel;
int yVel = pHitActor->spr.yvel;
pHitSprite->xvel = bcos(pActor->spr.ang, -2);
pHitSprite->yvel = bsin(pActor->spr.ang, -2);
pHitActor->spr.xvel = bcos(pActor->spr.ang, -2);
pHitActor->spr.yvel = bsin(pActor->spr.ang, -2);
MoveCreature(pHitActor);
pHitSprite->xvel = xVel;
pHitSprite->yvel = yVel;
pHitActor->spr.xvel = xVel;
pHitActor->spr.yvel = yVel;
}
break;
@ -441,11 +440,10 @@ MOVEEND:
if (BulletList[nBullet].pEnemy)
{
hitactor = BulletList[nBullet].pEnemy;
auto hitsprite = &hitactor->s();
x2 = hitsprite->pos.X;
y2 = hitsprite->pos.Y;
z2 = hitsprite->pos.Z - (GetActorHeight(hitactor) >> 1);
pHitSect = hitsprite->sector();
x2 = hitactor->spr.pos.X;
y2 = hitactor->spr.pos.Y;
z2 = hitactor->spr.pos.Z - (GetActorHeight(hitactor) >> 1);
pHitSect = hitactor->spr.sector();
}
else
{
@ -473,8 +471,7 @@ MOVEEND:
if (hitactor)
{
HITSPRITE:
auto hitsprite = &hitactor->s();
if (pActor->spr.pal == 5 && hitsprite->statnum == 100)
if (pActor->spr.pal == 5 && hitactor->spr.statnum == 100)
{
int nPlayer = GetPlayerFromActor(hitactor);
if (!PlayerList[nPlayer].bIsMummified)
@ -585,9 +582,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
{
if (pTarget)
{
spritetype *pTargetSprite = &pTarget->s();
if (pTargetSprite->cstat & CSTAT_SPRITE_BLOCK_ALL)
if (pTarget->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)
{
sBullet.nType = nType;
sBullet.nDoubleDamage = nDoubleDamage;
@ -597,9 +592,9 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
int nHeight = GetActorHeight(pTarget);
assert(pTargetSprite->sector());
assert(pTarget->spr.sector());
BulletHitsSprite(&sBullet, pActor, pTarget, pTargetSprite->pos.X, pTargetSprite->pos.Y, pTargetSprite->pos.Z - (nHeight >> 1), pTargetSprite->sector());
BulletHitsSprite(&sBullet, pActor, pTarget, pTarget->spr.pos.X, pTarget->spr.pos.Y, pTarget->spr.pos.Z - (nHeight >> 1), pTarget->spr.sector());
DeleteActor(sBullet.pActor);
return nullptr;
}
@ -627,50 +622,49 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
}
auto pBulletActor = insertActor(pSector, 200);
auto pBulletSprite = &pBulletActor->s();
int nHeight = GetActorHeight(pActor);
int nHeight = GetActorHeight(pActor);
nHeight = nHeight - (nHeight >> 2);
if (nZOffset == -1) {
nZOffset = -nHeight;
}
pBulletSprite->pos.X = pActor->spr.pos.X;
pBulletSprite->pos.Y = pActor->spr.pos.Y;
pBulletSprite->pos.Z = pActor->spr.pos.Z;
pBulletActor->spr.pos.X = pActor->spr.pos.X;
pBulletActor->spr.pos.Y = pActor->spr.pos.Y;
pBulletActor->spr.pos.Z = pActor->spr.pos.Z;
Bullet *pBullet = &BulletList[nBullet];
pBullet->pEnemy = nullptr;
pBulletSprite->cstat = 0;
pBulletSprite->shade = -64;
pBulletActor->spr.cstat = 0;
pBulletActor->spr.shade = -64;
if (pBulletInfo->nFlags & 4) {
pBulletSprite->pal = 4;
pBulletActor->spr.pal = 4;
}
else {
pBulletSprite->pal = 0;
pBulletActor->spr.pal = 0;
}
pBulletSprite->clipdist = 25;
pBulletActor->spr.clipdist = 25;
int nRepeat = pBulletInfo->xyRepeat;
if (nRepeat < 0) {
nRepeat = 30;
}
pBulletSprite->xrepeat = (uint8_t)nRepeat;
pBulletSprite->yrepeat = (uint8_t)nRepeat;
pBulletSprite->xoffset = 0;
pBulletSprite->yoffset = 0;
pBulletSprite->ang = nAngle;
pBulletSprite->xvel = 0;
pBulletSprite->yvel = 0;
pBulletSprite->zvel = 0;
pBulletSprite->lotag = runlist_HeadRun() + 1;
pBulletSprite->extra = -1;
pBulletSprite->hitag = 0;
pBulletActor->spr.xrepeat = (uint8_t)nRepeat;
pBulletActor->spr.yrepeat = (uint8_t)nRepeat;
pBulletActor->spr.xoffset = 0;
pBulletActor->spr.yoffset = 0;
pBulletActor->spr.ang = nAngle;
pBulletActor->spr.xvel = 0;
pBulletActor->spr.yvel = 0;
pBulletActor->spr.zvel = 0;
pBulletActor->spr.lotag = runlist_HeadRun() + 1;
pBulletActor->spr.extra = -1;
pBulletActor->spr.hitag = 0;
pBulletActor->pTarget = pActor;
pBulletActor->nPhase = nBullet;
@ -695,30 +689,30 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
pBullet->nSeq = nSeq;
pBulletSprite->picnum = seq_GetSeqPicnum(nSeq, 0, 0);
pBulletActor->spr.picnum = seq_GetSeqPicnum(nSeq, 0, 0);
if (nSeq == kSeqBullet) {
pBulletSprite->cstat |= CSTAT_SPRITE_INVISIBLE;
pBulletActor->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
}
pBullet->nPitch = nPitch;
pBullet->nType = nType;
pBullet->pActor = pBulletActor;
pBullet->nRunRec = runlist_AddRunRec(pBulletSprite->lotag - 1, nBullet, 0xB0000);
pBullet->nRunRec = runlist_AddRunRec(pBulletActor->spr.lotag - 1, nBullet, 0xB0000);
pBullet->nRunRec2 = runlist_AddRunRec(NewRun, nBullet, 0xB0000);
pBullet->nDoubleDamage = nDoubleDamage;
pBulletSprite->pos.Z += nZOffset;
pBulletSprite->backuppos();
pBulletActor->spr.pos.Z += nZOffset;
pBulletActor->spr.backuppos();
int var_18 = 0;
pSector = pBulletSprite->sector();
pSector = pBulletActor->spr.sector();
while (pBulletSprite->pos.Z < pSector->ceilingz)
while (pBulletActor->spr.pos.Z < pSector->ceilingz)
{
if (pSector->pAbove == nullptr)
{
pBulletSprite->pos.Z = pSector->ceilingz;
pBulletActor->spr.pos.Z = pSector->ceilingz;
break;
}
@ -732,8 +726,6 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
}
else
{
auto pTargetSprite = &pTarget->s();
if ((unsigned int)pBulletInfo->field_4 > 30000)
{
BulletList[nBullet].pEnemy = pTarget;
@ -742,7 +734,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
{
nHeight = GetActorHeight(pTarget);
if (pTargetSprite->statnum == 100)
if (pTarget->spr.statnum == 100)
{
nHeight -= nHeight >> 2;
}
@ -751,19 +743,19 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
nHeight -= nHeight >> 1;
}
int var_20 = pTargetSprite->pos.Z - nHeight;
int var_20 = pTarget->spr.pos.Z - nHeight;
int x, y;
if (pActor != nullptr && pActor->spr.statnum != 100)
{
x = pTargetSprite->pos.X;
y = pTargetSprite->pos.Y;
x = pTarget->spr.pos.X;
y = pTarget->spr.pos.Y;
if (pTargetSprite->statnum != 100)
if (pTarget->spr.statnum != 100)
{
x += (pTargetSprite->xvel * 20) >> 6;
y += (pTargetSprite->yvel * 20) >> 6;
x += (pTarget->spr.xvel * 20) >> 6;
y += (pTarget->spr.yvel * 20) >> 6;
}
else
{
@ -775,8 +767,8 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
}
}
x -= pBulletSprite->pos.X;
y -= pBulletSprite->pos.Y;
x -= pBulletActor->spr.pos.X;
y -= pBulletActor->spr.pos.Y;
nAngle = GetMyAngle(x, y);
pActor->spr.ang = nAngle;
@ -784,14 +776,14 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
else
{
// loc_2ABA3:
x = pTargetSprite->pos.X - pBulletSprite->pos.X;
y = pTargetSprite->pos.Y - pBulletSprite->pos.Y;
x = pTarget->spr.pos.X - pBulletActor->spr.pos.X;
y = pTarget->spr.pos.Y - pBulletActor->spr.pos.Y;
}
int nSqrt = lsqrt(y*y + x*x);
if ((unsigned int)nSqrt > 0)
{
var_18 = ((var_20 - pBulletSprite->pos.Z) * pBulletInfo->field_4) / nSqrt;
var_18 = ((var_20 - pBulletActor->spr.pos.Z) * pBulletInfo->field_4) / nSqrt;
}
else
{

View file

@ -53,33 +53,31 @@ void ThrowGrenade(int nPlayer, int, int, int ecx, int push1)
return;
DExhumedActor* pActor = PlayerList[nPlayer].pPlayerGrenade;
auto pGrenadeSprite = &pActor->s();
auto pPlayerActor = PlayerList[nPlayer].Actor();
auto pPlayerSprite = &pPlayerActor->s();
int nAngle = pPlayerSprite->ang;
int nAngle = pPlayerActor->spr.ang;
ChangeActorSect(pActor, PlayerList[nPlayer].pPlayerViewSect);
pGrenadeSprite->pos.X = pPlayerSprite->pos.X;
pGrenadeSprite->pos.Y = pPlayerSprite->pos.Y;
pGrenadeSprite->pos.Z = pPlayerSprite->pos.Z;
pActor->spr.pos.X = pPlayerActor->spr.pos.X;
pActor->spr.pos.Y = pPlayerActor->spr.pos.Y;
pActor->spr.pos.Z = pPlayerActor->spr.pos.Z;
if (nAngle < 0) {
nAngle = pPlayerSprite->ang;
nAngle = pPlayerActor->spr.ang;
}
pGrenadeSprite->cstat &= ~CSTAT_SPRITE_BLOCK;
pGrenadeSprite->ang = nAngle;
pActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK;
pActor->spr.ang = nAngle;
if (push1 >= -3000)
{
int nVel = PlayerList[nPlayer].totalvel << 5;
pActor->nTurn = ((90 - pActor->nIndex2) * (90 - pActor->nIndex2)) + nVel;
pGrenadeSprite->zvel = (-64 * push1) - 4352;
pActor->spr.zvel = (-64 * push1) - 4352;
auto nMov = movesprite(pActor, bcos(nAngle) * (pPlayerSprite->clipdist << 3), bsin(nAngle) * (pPlayerSprite->clipdist << 3), ecx, 0, 0, CLIPMASK1);
auto nMov = movesprite(pActor, bcos(nAngle) * (pPlayerActor->spr.clipdist << 3), bsin(nAngle) * (pPlayerActor->spr.clipdist << 3), ecx, 0, 0, CLIPMASK1);
if (nMov.type == kHitWall)
{
nAngle = GetWallNormal(nMov.hitWall);
@ -89,7 +87,7 @@ void ThrowGrenade(int nPlayer, int, int, int ecx, int push1)
else
{
pActor->nTurn = 0;
pGrenadeSprite->zvel = pPlayerSprite->zvel;
pActor->spr.zvel = pPlayerActor->spr.zvel;
}
pActor->x = bcos(nAngle, -4) * pActor->nTurn;
@ -104,11 +102,11 @@ void BuildGrenade(int nPlayer)
{
auto pActor = insertActor(PlayerList[nPlayer].pPlayerViewSect, 201);
auto pPlayerSprite = &PlayerList[nPlayer].Actor()->s();
auto pPlayerActor = PlayerList[nPlayer].Actor();
pActor->spr.pos.X = pPlayerSprite->pos.X;
pActor->spr.pos.Y = pPlayerSprite->pos.Y;
pActor->spr.pos.Z = pPlayerSprite->pos.Z - 3840;
pActor->spr.pos.X = pPlayerActor->spr.pos.X;
pActor->spr.pos.Y = pPlayerActor->spr.pos.Y;
pActor->spr.pos.Z = pPlayerActor->spr.pos.Z - 3840;
pActor->spr.shade = -64;
pActor->spr.xrepeat = 20;
pActor->spr.yrepeat = 20;
@ -118,7 +116,7 @@ void BuildGrenade(int nPlayer)
pActor->spr.clipdist = 30;
pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0;
pActor->spr.ang = pPlayerSprite->ang;
pActor->spr.ang = pPlayerActor->spr.ang;
pActor->spr.owner = nPlayer;
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;
@ -146,9 +144,8 @@ void ExplodeGrenade(DExhumedActor* pActor)
{
int var_28, var_20;
auto pGrenadeSprite = &pActor->s();
int nPlayer = pGrenadeSprite->owner;
auto pGrenadeSect = pGrenadeSprite->sector();
int nPlayer = pActor->spr.owner;
auto pGrenadeSect = pActor->spr.sector();
pActor->nFrame = 1;
@ -159,7 +156,7 @@ void ExplodeGrenade(DExhumedActor* pActor)
}
else
{
if (pGrenadeSprite->pos.Z < pGrenadeSect->floorz)
if (pActor->spr.pos.Z < pGrenadeSect->floorz)
{
var_20 = 200;
var_28 = 36;
@ -178,14 +175,13 @@ void ExplodeGrenade(DExhumedActor* pActor)
if (pActor->nTurn < 0)
{
auto pPlayerActor = PlayerList[nPlayer].Actor();
auto pPlayerSprite = &pPlayerActor->s();
int nAngle = pPlayerSprite->ang;
int nAngle = pPlayerActor->spr.ang;
pGrenadeSprite->pos.Z = pPlayerSprite->pos.Z;
pGrenadeSprite->pos.X = bcos(nAngle, -5) + pPlayerSprite->pos.X;
pGrenadeSprite->pos.Y = bsin(nAngle, -5) + pPlayerSprite->pos.Y;
pActor->spr.pos.Z = pPlayerActor->spr.pos.Z;
pActor->spr.pos.X = bcos(nAngle, -5) + pPlayerActor->spr.pos.X;
pActor->spr.pos.Y = bsin(nAngle, -5) + pPlayerActor->spr.pos.Y;
ChangeActorSect(pActor, pPlayerSprite->sector());
ChangeActorSect(pActor, pPlayerActor->spr.sector());
if (!PlayerList[nPlayer].invincibility) {
PlayerList[nPlayer].nHealth = 1;
@ -200,8 +196,8 @@ void ExplodeGrenade(DExhumedActor* pActor)
runlist_RadialDamageEnemy(pActor, nDamage, BulletInfo[kWeaponGrenade].nRadius);
BuildAnim(nullptr, var_28, 0, pGrenadeSprite->pos.X, pGrenadeSprite->pos.Y, pGrenadeSprite->pos.Z, pGrenadeSprite->sector(), var_20, 4);
AddFlash(pGrenadeSprite->sector(), pGrenadeSprite->pos.X, pGrenadeSprite->pos.Y, pGrenadeSprite->pos.Z, 128);
BuildAnim(nullptr, var_28, 0, pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z, pActor->spr.sector(), var_20, 4);
AddFlash(pActor->spr.sector(), pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z, 128);
DestroyGrenade(pActor);
}
@ -221,16 +217,15 @@ void AIGrenade::Tick(RunListEvent* ev)
auto pActor = ev->pObjActor;
if (!pActor) return;
auto pGrenadeSprite = &pActor->s();
int nSeq = pActor->nFrame ? SeqOffsets[kSeqGrenBoom] : SeqOffsets[kSeqGrenRoll] + pActor->nIndex;
seq_MoveSequence(pActor, nSeq, pActor->nHealth >> 8);
pGrenadeSprite->picnum = seq_GetSeqPicnum2(nSeq, pActor->nHealth >> 8);
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nHealth >> 8);
pActor->nIndex2--;
if (!pActor->nIndex2)
{
int nPlayer = pGrenadeSprite->owner;
int nPlayer = pActor->spr.owner;
if (pActor->nTurn < 0)
{
@ -287,10 +282,10 @@ void AIGrenade::Tick(RunListEvent* ev)
return;
}
int zVel = pGrenadeSprite->zvel;
int zVel = pActor->spr.zvel;
Gravity(pActor);
auto nMov = movesprite(pActor, pActor->x, pActor->y, pGrenadeSprite->zvel, pGrenadeSprite->clipdist >> 1, pGrenadeSprite->clipdist >> 1, CLIPMASK1);
auto nMov = movesprite(pActor, pActor->x, pActor->y, pActor->spr.zvel, pActor->spr.clipdist >> 1, pActor->spr.clipdist >> 1, CLIPMASK1);
if (!nMov.type && !nMov.exbits)
return;
@ -299,7 +294,7 @@ void AIGrenade::Tick(RunListEvent* ev)
{
if (zVel)
{
if (pGrenadeSprite->sector()->Damage > 0)
if (pActor->spr.sector()->Damage > 0)
{
ExplodeGrenade(pActor);
return;
@ -309,14 +304,14 @@ void AIGrenade::Tick(RunListEvent* ev)
D3PlayFX(StaticSound[kSound3], pActor);
pGrenadeSprite->zvel = -(zVel >> 1);
pActor->spr.zvel = -(zVel >> 1);
if (pGrenadeSprite->zvel > -1280)
if (pActor->spr.zvel > -1280)
{
D3PlayFX(StaticSound[kSound5], pActor);
pActor->nCount = 0;
pActor->nHealth = 0;
pGrenadeSprite->zvel = 0;
pActor->spr.zvel = 0;
pActor->nIndex = 1;
}
}

View file

@ -319,7 +319,6 @@ void MoveWeapons(int nPlayer)
nTemperature[nPlayer] = 0;
auto pPlayerActor = PlayerList[nPlayer].Actor();
auto pPlayerSprite = &pPlayerActor->s();
int nWeapon = PlayerList[nPlayer].nCurrentWeapon;
if (nWeapon < -1)
@ -614,10 +613,10 @@ loc_flag:
{
BuildFlash(nPlayer, 512);
AddFlash(
pPlayerSprite->sector(),
pPlayerSprite->pos.X,
pPlayerSprite->pos.Y,
pPlayerSprite->pos.Z,
pPlayerActor->spr.sector(),
pPlayerActor->spr.pos.X,
pPlayerActor->spr.pos.Y,
pPlayerActor->spr.pos.Z,
0);
}
@ -648,13 +647,13 @@ loc_flag:
}
int nAmmoType = WeaponInfo[nWeapon].nAmmoType;
int nAngle = pPlayerSprite->ang;
int theX = pPlayerSprite->pos.X;
int theY = pPlayerSprite->pos.Y;
int theZ = pPlayerSprite->pos.Z;
int nAngle = pPlayerActor->spr.ang;
int theX = pPlayerActor->spr.pos.X;
int theY = pPlayerActor->spr.pos.Y;
int theZ = pPlayerActor->spr.pos.Z;
int ebp = bcos(nAngle) * (pPlayerSprite->clipdist << 3);
int ebx = bsin(nAngle) * (pPlayerSprite->clipdist << 3);
int ebp = bcos(nAngle) * (pPlayerActor->spr.clipdist << 3);
int ebx = bsin(nAngle) * (pPlayerActor->spr.clipdist << 3);
if (WeaponInfo[nWeapon].c)
{
@ -688,7 +687,7 @@ loc_flag:
}
}
auto pSectorB = pPlayerSprite->sector();
auto pSectorB = pPlayerActor->spr.sector();
switch (nWeapon)
{
@ -728,25 +727,24 @@ loc_flag:
else if (cRange.type == kHitSprite)
{
auto pActor2 = cRange.actor();
auto pSprite2 = &pActor2->s();
if (pSprite2->cstat & (CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_ONE_SIDE))
if (pActor2->spr.cstat & (CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_ONE_SIDE))
{
var_28 += 2;
}
else if (pSprite2->statnum > 90 && pSprite2->statnum <= 199)
else if (pActor2->spr.statnum > 90 && pActor2->spr.statnum <= 199)
{
runlist_DamageEnemy(pActor2, pPlayerActor, nDamage);
if (pSprite2->statnum < 102) {
if (pActor2->spr.statnum < 102) {
var_28++;
}
else if (pSprite2->statnum == 102)
else if (pActor2->spr.statnum == 102)
{
// loc_27370:
BuildAnim(nullptr, 12, 0, theX, theY, theZ, pSectorB, 30, 0);
}
else if (pSprite2->statnum == kStatExplodeTrigger) {
else if (pActor2->spr.statnum == kStatExplodeTrigger) {
var_28 += 2;
}
else {
@ -809,10 +807,9 @@ loc_flag:
{
DExhumedActor* t = sPlayerInput[nPlayer].pTarget;
// only autoaim if target is in front of the player.
auto pTargetSprite = &t->s();
assert(pTargetSprite->sector());
int angletotarget = bvectangbam(pTargetSprite->pos.X - pPlayerSprite->pos.X, pTargetSprite->pos.Y - pPlayerSprite->pos.Y).asbuild();
int anglediff = (pPlayerSprite->ang - angletotarget) & 2047;
assert(t->spr.sector());
int angletotarget = bvectangbam(t->spr.pos.X - pPlayerActor->spr.pos.X, t->spr.pos.Y - pPlayerActor->spr.pos.Y).asbuild();
int anglediff = (pPlayerActor->spr.ang - angletotarget) & 2047;
if (anglediff < 512 || anglediff > 1536)
{
target = t;
@ -833,8 +830,8 @@ loc_flag:
BuildSnake(nPlayer, nHeight);
nQuake[nPlayer] = 512;
PlayerList[nPlayer].nXDamage -= bcos(pPlayerSprite->ang, 9);
PlayerList[nPlayer].nYDamage -= bsin(pPlayerSprite->ang, 9);
PlayerList[nPlayer].nXDamage -= bcos(pPlayerActor->spr.ang, 9);
PlayerList[nPlayer].nYDamage -= bsin(pPlayerActor->spr.ang, 9);
break;
}
case kWeaponRing: