- restored original whitespacing in blood/actor.cpp.

This ensures that future cherry picks won't conflict as badly.
This commit is contained in:
Christoph Oelckers 2019-10-20 16:50:47 +02:00
parent 70e0ed9ec4
commit d83b3f34a3

View file

@ -2774,9 +2774,11 @@ void ConcussSprite(int a1, spritetype *pSprite, int x, int y, int z, int a6)
int dist2 = 0x40000+dx*dx+dy*dy+dz*dz;
dassert(dist2 > 0);
a6 = scale(0x40000, a6, dist2);
if (pSprite->flags & kPhysMove) {
int mass = 0;
if (IsDudeSprite(pSprite)) {
mass = dudeInfo[pSprite->type - kDudeBase].mass;
switch (pSprite->type) {
case kDudeModernCustom:
@ -2865,6 +2867,7 @@ void sub_2A620(int nSprite, int x, int y, int z, int nSector, int nDist, int a7,
spritetype *pSprite2 = &sprite[i];
if (pSprite2->extra > 0 && pSprite2->extra < kMaxXSprites)
{
if (pSprite2->flags & 0x20)
continue;
if (!TestBitString(va0, pSprite2->sectnum))
@ -2894,6 +2897,7 @@ void sub_2A620(int nSprite, int x, int y, int z, int nSector, int nDist, int a7,
for (int i = headspritestat[kStatThing]; i >= 0; i = nextspritestat[i])
{
spritetype *pSprite2 = &sprite[i];
if (pSprite2->flags&0x20)
continue;
if (!TestBitString(va0, pSprite2->sectnum))
@ -2927,6 +2931,7 @@ void sub_2AA94(spritetype *pSprite, XSPRITE *pXSprite)
seqSpawn(9, 3, pSprite->extra);
if (Chance(0x8000))
pSprite->cstat |= 4;
sfxPlay3DSound(pSprite, 303, 24+(pSprite->flags&3), 1);
sub_2A620(nSprite, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, 128, 0, 60, DAMAGE_TYPE_3, 15, 120, 0, 0);
if (pXSprite->data4 > 1)
@ -3134,6 +3139,7 @@ void actKillDude(int nKillerSprite, spritetype *pSprite, DAMAGE_TYPE damageType,
if (pXSprite->dropMsg > 0) // drop items
actDropObject(pSprite, pXSprite->dropMsg);
pSprite->flags &= ~kPhysMove; xvel[pSprite->index] = yvel[pSprite->index] = 0;
int seqId = pXSprite->data2 + 18;
@ -3212,6 +3218,7 @@ void actKillDude(int nKillerSprite, spritetype *pSprite, DAMAGE_TYPE damageType,
}
if (pSprite->type != kDudeCultistBeast)
trTriggerSprite(pSprite->index, pXSprite, kCmdOff);
pSprite->flags |= 7;
if (VanillaMode()) {
if (IsPlayerSprite(pKillerSprite)) {
@ -3627,6 +3634,7 @@ void actKillDude(int nKillerSprite, spritetype *pSprite, DAMAGE_TYPE damageType,
if (pSprite->owner != -1 && pSprite->owner != (kMaxSprites - 1)) {
//int owner = actSpriteIdToOwnerId(pSprite->xvel);
int owner = pSprite->owner;
switch (sprite[owner].type) {
case kDudeModernCustom:
case kDudeModernCustomBurning:
@ -3654,6 +3662,7 @@ void actKillDude(int nKillerSprite, spritetype *pSprite, DAMAGE_TYPE damageType,
int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE damageType, int damage) {
dassert(nSource < kMaxSprites);
if (pSprite->flags&32 || pSprite->extra <= 0 || pSprite->extra >= kMaxXSprites || xsprite[pSprite->extra].reference != pSprite->index)
return 0;
@ -3673,8 +3682,9 @@ int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE damageType, in
if (!IsDudeSprite(pSprite)) {
consoleSysMsg("Bad Dude Failed: initial=%d type=%d %s\n", (int)pSprite->inittype, (int)pSprite->type, (int)(pSprite->flags & kHitagRespawn) ? "RESPAWN" : "NORMAL");
return damage >> 4;
//ThrowError("Bad Dude Failed: initial=%d type=%d %s\n", (int)pSprite->inittype, (int)pSprite->type, (int)(pSprite->flags & kHitagRespawn) ? "RESPAWN" : "NORMAL");
//ThrowError("Bad Dude Failed: initial=%d type=%d %s\n", (int)pSprite->inittype, (int)pSprite->type, (int)(pSprite->flags & 16) ? "RESPAWN" : "NORMAL");
}
int nType = pSprite->type - kDudeBase; int nDamageFactor = dudeInfo[nType].at70[damageType];
if (!nDamageFactor) return 0;
@ -3875,6 +3885,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode)
XSPRITE* pXSource = (pSource->extra >= 0) ? &xsprite[pSource->extra] : NULL;
if (IsDudeSprite(pSource) && pXSource != NULL && pXSource->health != 0)
actHealDude(pXSource, nDamage >> 2, dudeInfo[pSource->type - kDudeBase].startHealth);
}
}
@ -4143,9 +4154,11 @@ void actTouchFloor(spritetype *pSprite, int nSector)
if (pSector->extra > 0)
pXSector = &xsector[pSector->extra];
if (pXSector && (pSector->type == kSectorDamage || pXSector->damageType > 0))
{
DAMAGE_TYPE nDamageType;
if (pSector->type == kSectorDamage)
nDamageType = (DAMAGE_TYPE)ClipRange(pXSector->damageType, DAMAGE_TYPE_0, DAMAGE_TYPE_6);
else
@ -4189,8 +4202,10 @@ void ProcessTouchObjects(spritetype *pSprite, int nXSprite)
int nType = pSprite2->type-kThingBase;
THINGINFO *pThingInfo = &thingInfo[nType];
if (pThingInfo->flags&1)
pSprite2->flags |= 1;
if (pThingInfo->flags&2)
pSprite2->flags |= 4;
// Inlined ?
xvel[pSprite2->index] += mulscale(4, pSprite2->x-sprite[nSprite].x, 2);
@ -4198,6 +4213,7 @@ void ProcessTouchObjects(spritetype *pSprite, int nXSprite)
}
else
{
pSprite2->flags |= 5;
xvel[pSprite2->index] += mulscale(4, pSprite2->x-sprite[nSprite].x, 2);
yvel[pSprite2->index] += mulscale(4, pSprite2->y-sprite[nSprite].y, 2);
@ -4596,6 +4612,7 @@ int MoveThing(spritetype *pSprite)
int v20 = zvel[nSprite]-velFloor[pSprite->sectnum];
if (v20 > 0)
{
pSprite->flags |= 4;
int vax = actFloorBounceVector((int*)&xvel[nSprite], (int*)&yvel[nSprite], (int*)&v20, pSprite->sectnum, pThingInfo->at7);
int nDamage = mulscale(vax, vax, 30)-pThingInfo->atb;
@ -4605,6 +4622,7 @@ int MoveThing(spritetype *pSprite)
if (velFloor[pSprite->sectnum] == 0 && klabs(zvel[nSprite]) < 0x10000)
{
zvel[nSprite] = 0;
pSprite->flags &= ~4;
}
@ -4627,11 +4645,13 @@ int MoveThing(spritetype *pSprite)
v8 = 0x4000|nSector;
}
else if (zvel[nSprite] == 0)
pSprite->flags &= ~4;
}
else
{
gSpriteHit[nXSprite].florhit = 0;
if (pSprite->flags&2)
pSprite->flags |= 4;
}
@ -4723,6 +4743,7 @@ void MoveDude(spritetype *pSprite)
if (pSprite->statnum == kStatDude || pSprite->statnum == kStatThing)
actDamageSprite(pSprite->index, pSprite, DAMAGE_TYPE_0, 1000<<4);
}
if (sector[nSector].type >= kSectorPath && sector[nSector].type <= kSectorRotate)
{
short nSector2 = nSector;
@ -4745,6 +4766,7 @@ void MoveDude(spritetype *pSprite)
if (pSprite->extra > 0)
pHitXSprite = &xsprite[pHitSprite->extra];
int nOwner = actSpriteOwnerToSpriteId(pHitSprite);
if (pHitSprite->statnum == kStatProjectile && !(pHitSprite->flags&32) && pSprite->index != nOwner)
{
HITINFO hitInfo = gHitInfo;
@ -4815,6 +4837,7 @@ void MoveDude(spritetype *pSprite)
nXSector = sector[nSector].extra;
pXSector = (nXSector > 0) ? pXSector = &xsector[nXSector] : NULL;
if (pXSector && pXSector->Enter && (pPlayer || !pXSector->at37_7)) {
if (sector[nSector].type == kSectorTeleport)
pXSector->data = pPlayer ? nSprite : -1;
trTriggerSector(nSector, pXSector, kCmdSectorEnter);
@ -4845,6 +4868,7 @@ void MoveDude(spritetype *pSprite)
int ceilZ, ceilHit, floorZ, floorHit;
GetZRange(pSprite, &ceilZ, &ceilHit, &floorZ, &floorHit, wd, CLIPMASK0, PARALLAXCLIP_CEILING|PARALLAXCLIP_FLOOR);
GetSpriteExtents(pSprite, &top, &bottom);
if (pSprite->flags & 2)
{
int vc = 58254;
@ -4999,6 +5023,7 @@ void MoveDude(spritetype *pSprite)
evPost(nSprite, 3, 0, kCallbackEnemeyBubble);
sfxPlay3DSound(pSprite, 720, -1, 0);
aiNewState(pSprite, pXSprite, &gillBeastSwimGoto);
pSprite->flags &= ~6;
break;
case kDudeGargoyleFlesh:
@ -5116,6 +5141,7 @@ void MoveDude(spritetype *pSprite)
if (pPlayer)
{
pPlayer->at31b = 0;
if (nDamage > (15<<4) && (pSprite->flags&4))
playerLandingSound(pPlayer);
if (nDamage > (30<<4))
@ -5128,9 +5154,11 @@ void MoveDude(spritetype *pSprite)
if (klabs(zvel[nSprite]) < 0x10000)
{
zvel[nSprite] = velFloor[pSprite->sectnum];
pSprite->flags &= ~4;
}
else
pSprite->flags |= 4;
switch (tileGetSurfType(floorHit))
{
@ -5158,11 +5186,13 @@ void MoveDude(spritetype *pSprite)
}
}
else if (zvel[nSprite] == 0)
pSprite->flags &= ~4;
}
else
{
gSpriteHit[nXSprite].florhit = 0;
if (pSprite->flags&2)
pSprite->flags |= 4;
}
@ -5170,6 +5200,7 @@ void MoveDude(spritetype *pSprite)
{
gSpriteHit[nXSprite].ceilhit = ceilHit;
pSprite->z += ClipLow(ceilZ-top, 0);
if (zvel[nSprite] <= 0 && (pSprite->flags&4))
zvel[nSprite] = mulscale16(-zvel[nSprite], 0x2000);
}
@ -5506,6 +5537,7 @@ void actExplodeSprite(spritetype *pSprite)
xvel[nSprite] = yvel[nSprite] = zvel[nSprite] = 0;
actPostSprite(nSprite, kStatExplosion);
pSprite->xrepeat = pSprite->yrepeat = explodeInfo[nType].at0;
pSprite->flags &= ~3;
pSprite->type = nType;
EXPLOSION *pExplodeInfo = &explodeInfo[nType];
@ -5532,6 +5564,7 @@ void actActivateGibObject(spritetype *pSprite, XSPRITE *pXSprite)
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, vbp, pSprite->sectnum);
if (v8 > 0)
actDropObject(pSprite, v8);
if (!(pSprite->cstat&32768) && !(pSprite->flags&kHitagRespawn))
actPostSprite(pSprite->index, kStatFree);
}
@ -5571,6 +5604,7 @@ void actProcessSprites(void)
if (!pXProxSpr->DudeLockout) {
for (int nAffected = headspritestat[kStatDude]; nAffected >= 0; nAffected = nextspritestat[nAffected]) {
if ((sprite[nAffected].flags & 32) || xsprite[sprite[nAffected].extra].health <= 0) continue;
else if (CheckProximity(&sprite[nAffected], x, y, z, sectnum, 96)) {
trTriggerSprite(index, pXProxSpr, kCmdSpriteProximity);
@ -5619,6 +5653,7 @@ void actProcessSprites(void)
//System.err.println("PHYS COUNT: "+gPhysSpritesCount);
for (int i = 0; i < gPhysSpritesCount; i++) {
if (gPhysSpritesList[i] == -1) continue;
else if (sprite[gPhysSpritesList[i]].statnum == kStatFree || (sprite[gPhysSpritesList[i]].flags & kHitagFree) != 0) {
gPhysSpritesList[i] = -1;
continue;
@ -5692,6 +5727,7 @@ void actProcessSprites(void)
for (nSprite = headspritestat[kStatThing]; nSprite >= 0; nSprite = nextspritestat[nSprite])
{
spritetype *pSprite = &sprite[nSprite];
if (pSprite->flags&32)
continue;
int nXSprite = pSprite->extra;
@ -5722,6 +5758,7 @@ void actProcessSprites(void)
nNextSprite = nextspritestat[nSprite2];
spritetype *pSprite2 = &sprite[nSprite2];
if (pSprite2->flags&32) continue;
XSPRITE *pXSprite2 = &xsprite[pSprite2->extra];
if ((unsigned int)pXSprite2->health > 0) {
@ -5775,6 +5812,7 @@ void actProcessSprites(void)
for (nSprite = headspritestat[kStatThing]; nSprite >= 0; nSprite = nextspritestat[nSprite])
{
spritetype *pSprite = &sprite[nSprite];
if (pSprite->flags & 32)
continue;
int nSector = pSprite->sectnum;
@ -5793,10 +5831,13 @@ void actProcessSprites(void)
int nType = pSprite->type - kThingBase;
THINGINFO *pThingInfo = &thingInfo[nType];
if (pThingInfo->flags & 1)
pSprite->flags |= 1;
if (pThingInfo->flags & 2)
pSprite->flags |= 4;
}
if (pSprite->flags&3)
{
viewBackupSpriteLoc(nSprite, pSprite);
@ -5823,6 +5864,7 @@ void actProcessSprites(void)
}
}
actAirDrag(pSprite, 128);
if (((pSprite->index>>8)&15) == (gFrame&15) && (pSprite->flags&2))
pSprite->flags |= 4;
if ((pSprite->flags&4) || xvel[nSprite] || yvel[nSprite] || zvel[nSprite] ||
@ -5901,6 +5943,7 @@ void actProcessSprites(void)
for (nSprite = headspritestat[kStatProjectile]; nSprite >= 0; nSprite = nextspritestat[nSprite])
{
spritetype *pSprite = &sprite[nSprite];
if (pSprite->flags & 32)
continue;
viewBackupSpriteLoc(nSprite, pSprite);
@ -5912,6 +5955,7 @@ void actProcessSprites(void)
{
char v24c[(kMaxSectors+7)>>3];
spritetype *pSprite = &sprite[nSprite];
if (pSprite->flags & 32)
continue;
int nOwner = actSpriteOwnerToSpriteId(pSprite);
@ -5948,6 +5992,7 @@ void actProcessSprites(void)
for (int nSprite2 = headspritestat[kStatDude]; nSprite2 >= 0; nSprite2 = nextspritestat[nSprite2])
{
spritetype *pDude = &sprite[nSprite2];
if (pDude->flags & 32)
continue;
if (TestBitString(v24c, pDude->sectnum))
@ -5976,6 +6021,7 @@ void actProcessSprites(void)
for (int nSprite2 = headspritestat[kStatThing]; nSprite2 >= 0; nSprite2 = nextspritestat[nSprite2])
{
spritetype *pThing = &sprite[nSprite2];
if (pThing->flags & 32)
continue;
if (TestBitString(v24c, pThing->sectnum))
@ -6004,6 +6050,7 @@ void actProcessSprites(void)
if (gPhysSpritesCount > 0 && pExplodeInfo->dmgType != 0 && pXSprite->data1 != 0) {
for (int i = 0; i < gPhysSpritesCount; i++) {
if (gPhysSpritesList[i] == -1) continue;
else if (sprite[gPhysSpritesList[i]].sectnum < 0 || (sprite[gPhysSpritesList[i]].flags & kHitagFree) != 0)
continue;
@ -6026,6 +6073,7 @@ void actProcessSprites(void)
// By NoOne: if data4 > 0, do not remove explosion. This can be useful when designer wants put explosion generator in map manually
// via sprite statnum 2.
if (!gModernMap || !(pSprite->flags & kModernTypeFlag1)) {
pXSprite->data1 = ClipLow(pXSprite->data1 - 4, 0);
pXSprite->data2 = ClipLow(pXSprite->data2 - 4, 0);
@ -6038,6 +6086,7 @@ void actProcessSprites(void)
for (nSprite = headspritestat[kStatTraps]; nSprite >= 0; nSprite = nextspritestat[nSprite]) {
spritetype *pSprite = &sprite[nSprite];
if (pSprite->flags & 32)
continue;
int nXSprite = pSprite->extra;
@ -6078,6 +6127,7 @@ void actProcessSprites(void)
for (nSprite = headspritestat[kStatDude]; nSprite >= 0; nSprite = nextspritestat[nSprite])
{
spritetype *pSprite = &sprite[nSprite];
if (pSprite->flags & 32)
continue;
int nXSprite = pSprite->extra;
@ -6119,6 +6169,7 @@ void actProcessSprites(void)
// trigger dude death before transform
trTriggerSprite(nSprite, pXSprite, kCmdOff);
pSprite->type = pIncarnation->type;
pSprite->flags = pIncarnation->flags;
pSprite->pal = pIncarnation->pal;
@ -6196,6 +6247,7 @@ void actProcessSprites(void)
// remove the incarnation in case if non-locked
if (pXIncarnation->locked == 0) {
pXIncarnation->txID = pIncarnation->type = 0;
actPostSprite(pIncarnation->xvel, kStatFree);
// or restore triggerOn and off options
@ -6229,6 +6281,7 @@ void actProcessSprites(void)
{
nNextSprite = nextspritestat[nSprite2];
spritetype *pSprite2 = &sprite[nSprite2];
if (pSprite2->flags&32)
continue;
XSPRITE *pXSprite2 = &xsprite[pSprite2->extra];
@ -6284,6 +6337,7 @@ void actProcessSprites(void)
for (nSprite = headspritestat[kStatDude]; nSprite >= 0; nSprite = nextspritestat[nSprite])
{
spritetype *pSprite = &sprite[nSprite];
if (pSprite->flags & 32)
continue;
int nXSprite = pSprite->extra;
@ -6324,6 +6378,7 @@ void actProcessSprites(void)
actAirDrag(pSprite, 5376);
else
actAirDrag(pSprite, 128);
if ((pSprite->flags&4) || xvel[nSprite] || yvel[nSprite] || zvel[nSprite] ||
velFloor[pSprite->sectnum] || velCeil[pSprite->sectnum])
MoveDude(pSprite);
@ -6331,6 +6386,7 @@ void actProcessSprites(void)
for (nSprite = headspritestat[kStatFlare]; nSprite >= 0; nSprite = nextspritestat[nSprite])
{
spritetype *pSprite = &sprite[nSprite];
if (pSprite->flags & 32)
continue;
int nXSprite = pSprite->extra;
@ -7480,6 +7536,7 @@ spritetype* actSpawnCustomDude(spritetype* pSprite, int nDist) {
if (pXSource->data4 <= 0) pXDude->health = dudeInfo[nType].startHealth << 4;
else pXDude->health = ClipRange(pXSource->data4 << 4, 1, 65535);
if (pSource->flags & kModernTypeFlag1) {
switch (pSource->type) {
case kModernCustomDudeSpawn:
@ -7515,6 +7572,7 @@ int getSpriteMassBySize(spritetype* pSprite) {
int mass = 0; int seqId = -1; Seq* pSeq = NULL;
if (IsDudeSprite(pSprite)) {
switch (pSprite->type) {
case kDudePodMother: // fake dude, no seq
break;
@ -7523,6 +7581,7 @@ int getSpriteMassBySize(spritetype* pSprite) {
seqId = xsprite[pSprite->extra].data2;
break;
default:
seqId = dudeInfo[pSprite->type - kDudeBase].seqStartID;
break;
}
@ -7625,6 +7684,7 @@ int isDebris(int nSprite) {
int debrisGetFreeIndex(void) {
for (int i = 0; i < kMaxSuperXSprites; i++) {
if (gPhysSpritesList[i] == -1 || sprite[gPhysSpritesList[i]].statnum == kStatFree) return i;
else if ((sprite[gPhysSpritesList[i]].flags & kHitagFree) || sprite[gPhysSpritesList[i]].extra < 0) return i;
else if (xsprite[sprite[gPhysSpritesList[i]].extra].physAttr == 0) return i;
}