mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 22:51:50 +00:00
- the final s()'s in Blood.
This commit is contained in:
parent
582b83601d
commit
5ad43256cc
3 changed files with 15 additions and 21 deletions
|
@ -119,10 +119,10 @@ void viewDrawAimedPlayerName(void)
|
|||
int hit = HitScan(gView->actor, gView->zView, gView->aim.dx, gView->aim.dy, gView->aim.dz, CLIPMASK0, 512);
|
||||
if (hit == 3)
|
||||
{
|
||||
if (gHitInfo.actor() && gHitInfo.actor()->IsPlayerActor())
|
||||
auto actor = gHitInfo.actor();
|
||||
if (actor && actor->IsPlayerActor())
|
||||
{
|
||||
spritetype* pSprite = &gHitInfo.actor()->s();
|
||||
int nPlayer = pSprite->type-kDudePlayer1;
|
||||
int nPlayer = actor->spr.type-kDudePlayer1;
|
||||
const char* szName = PlayerName(nPlayer);
|
||||
int nPalette = (gPlayer[nPlayer].teamId&3)+11;
|
||||
viewDrawText(DigiFont, szName, 160, 125, -128, nPalette, 1, 1);
|
||||
|
|
|
@ -172,9 +172,7 @@ void warpInit(TArray<DBloodActor*>& actors)
|
|||
auto actor2 = barrier_cast<DBloodActor*>(sect.lowerLink);
|
||||
if (actor2 && actor2->hasX())
|
||||
{
|
||||
spritetype *pSprite2 = &actor2->s();
|
||||
XSPRITE *pXSprite2 = &actor2->x();
|
||||
if (pXSprite2->data1 == nLink)
|
||||
if (actor2->xspr.data1 == nLink)
|
||||
{
|
||||
actor->SetOwner(actor2);
|
||||
actor2->SetOwner(actor);
|
||||
|
|
|
@ -1723,8 +1723,7 @@ void AltFireLifeLeech(int , PLAYER *pPlayer)
|
|||
auto missile = playerFireThing(pPlayer, 0, -4730, kThingDroppedLifeLeech, 0x19999);
|
||||
if (missile)
|
||||
{
|
||||
auto pMissile = &missile->s();
|
||||
pMissile->cstat |= CSTAT_SPRITE_BLOOD_BIT1;
|
||||
missile->spr.cstat |= CSTAT_SPRITE_BLOOD_BIT1;
|
||||
XSPRITE *pXSprite = &missile->x();
|
||||
pXSprite->Push = 1;
|
||||
pXSprite->Proximity = 1;
|
||||
|
@ -2654,12 +2653,11 @@ void WeaponProcess(PLAYER *pPlayer) {
|
|||
|
||||
void teslaHit(DBloodActor *missileactor, int a2)
|
||||
{
|
||||
auto pMissile = &missileactor->s();
|
||||
int x = pMissile->pos.X;
|
||||
int y = pMissile->pos.Y;
|
||||
int z = pMissile->pos.Z;
|
||||
int x = missileactor->spr.pos.X;
|
||||
int y = missileactor->spr.pos.Y;
|
||||
int z = missileactor->spr.pos.Z;
|
||||
int nDist = 300;
|
||||
auto pSector = pMissile->sector();
|
||||
auto pSector = missileactor->spr.sector();
|
||||
auto owneractor = missileactor->GetOwner();
|
||||
const bool newSectCheckMethod = !cl_bloodvanillaexplosions && !VanillaMode(); // use new sector checking logic
|
||||
auto sectorMap = GetClosestSpriteSectors(pSector, x, y, nDist, nullptr, newSectCheckMethod);
|
||||
|
@ -2673,13 +2671,12 @@ void teslaHit(DBloodActor *missileactor, int a2)
|
|||
{
|
||||
if (hitactor != owneractor || v4)
|
||||
{
|
||||
spritetype *pHitSprite = &hitactor->s();
|
||||
if (pHitSprite->flags&32)
|
||||
if (hitactor->spr.flags&32)
|
||||
continue;
|
||||
if (CheckSector(sectorMap, hitactor) && CheckProximity(hitactor, x, y, z, pSector, nDist))
|
||||
{
|
||||
int dx = pMissile->pos.X - pHitSprite->pos.X;
|
||||
int dy = pMissile->pos.Y - pHitSprite->pos.Y;
|
||||
int dx = missileactor->spr.pos.X - hitactor->spr.pos.X;
|
||||
int dy = missileactor->spr.pos.Y - hitactor->spr.pos.Y;
|
||||
int nDamage = ClipLow((nDist-(ksqrt(dx*dx+dy*dy)>>4)+20)>>1, 10);
|
||||
if (hitactor == owneractor)
|
||||
nDamage /= 2;
|
||||
|
@ -2690,16 +2687,15 @@ void teslaHit(DBloodActor *missileactor, int a2)
|
|||
it.Reset(kStatThing);
|
||||
while (auto hitactor = it.Next())
|
||||
{
|
||||
spritetype *pHitSprite = &hitactor->s();
|
||||
if (pHitSprite->flags&32)
|
||||
if (hitactor->spr.flags&32)
|
||||
continue;
|
||||
if (CheckSector(sectorMap, hitactor) && CheckProximity(hitactor, x, y, z, pSector, nDist))
|
||||
{
|
||||
XSPRITE *pXSprite = &hitactor->x();
|
||||
if (!pXSprite->locked)
|
||||
{
|
||||
int dx = pMissile->pos.X - pHitSprite->pos.X;
|
||||
int dy = pMissile->pos.Y - pHitSprite->pos.Y;
|
||||
int dx = missileactor->spr.pos.X - hitactor->spr.pos.X;
|
||||
int dy = missileactor->spr.pos.Y - hitactor->spr.pos.Y;
|
||||
int nDamage = ClipLow(nDist-(ksqrt(dx*dx+dy*dy)>>4)+20, 20);
|
||||
actDamageSprite(owneractor, hitactor, kDamageTesla, nDamage << 4);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue