diff --git a/source/games/blood/src/_polymost.cpp b/source/games/blood/src/_polymost.cpp index 2e4ea464a..d4c702b92 100644 --- a/source/games/blood/src/_polymost.cpp +++ b/source/games/blood/src/_polymost.cpp @@ -231,7 +231,7 @@ void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int sector.Data()[mirrorsector].floorz = sector[nSector].floorz; sector.Data()[mirrorsector].ceilingz = sector[nSector].ceilingz; int cx, cy, ca; - if (GetWallType(nWall) == kWallStack) + if (pWall->type == kWallStack) { cx = x - (wall[pWall->hitag].x - pWall->point2Wall()->x); cy = y - (wall[pWall->hitag].y - pWall->point2Wall()->y); @@ -244,7 +244,7 @@ void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int renderDrawRoomsQ16(cx, cy, z, ca, horiz, mirrorsector, true); viewProcessSprites(pm_tsprite, pm_spritesortcnt, cx, cy, z, FixedToInt(ca), smooth); renderDrawMasks(); - if (GetWallType(nWall) != kWallStack) + if (pWall->type != kWallStack) renderCompleteMirror(); pWall->nextwall = nNextWall; pWall->nextsector = nNextSector; diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index fb309b16f..24e4d186f 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -5368,18 +5368,18 @@ int MoveMissile(DBloodActor* actor) else if (clipmoveresult.type == kHitWall) { gHitInfo.hitwall = clipmoveresult.index; - if (wall[clipmoveresult.index].nextsector == -1) cliptype = 0; + if (clipmoveresult.wall()->nextsector == -1) cliptype = 0; else { int32_t fz, cz; - getzsofslope(wall[clipmoveresult.index].nextsector, pos.x, pos.y, &cz, &fz); + getzsofslope(clipmoveresult.wall()->nextsector, pos.x, pos.y, &cz, &fz); if (pos.z <= cz || pos.z >= fz) cliptype = 0; else cliptype = 4; } } if (cliptype == 4) { - walltype* pWall = &wall[gHitInfo.hitwall]; + walltype* pWall = clipmoveresult.wall(); if (pWall->hasX()) { XWALL* pXWall = &pWall->xw(); @@ -6814,14 +6814,12 @@ bool actCheckRespawn(DBloodActor* actor) // //--------------------------------------------------------------------------- -bool actCanSplatWall(int nWall) +bool actCanSplatWall(walltype* pWall) { - assert(validWallIndex(nWall)); - walltype* pWall = &wall[nWall]; if (pWall->cstat & 16384) return 0; if (pWall->cstat & 32768) return 0; - int nType = GetWallType(nWall); + int nType = pWall->type; if (nType >= kWallBase && nType < kWallMax) return 0; if (pWall->nextsector != -1) @@ -6896,7 +6894,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6, assert(validWallIndex(nWall)); auto pWall = &wall[nWall]; nSurf = surfType[pWall->picnum]; - if (actCanSplatWall(nWall)) + if (actCanSplatWall(pWall)) { int x = gHitInfo.hitx - MulScale(a4, 16, 14); int y = gHitInfo.hity - MulScale(a5, 16, 14); @@ -6999,7 +6997,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6, { int nWall = gHitInfo.hitwall; int nSector = gHitInfo.hitsect; - if (actCanSplatWall(nWall)) + if (actCanSplatWall(&wall[nWall])) { int x = gHitInfo.hitx - MulScale(a4, 16, 14); int y = gHitInfo.hity - MulScale(a5, 16, 14); diff --git a/source/games/blood/src/actor.h b/source/games/blood/src/actor.h index 137f7f51f..f176251bc 100644 --- a/source/games/blood/src/actor.h +++ b/source/games/blood/src/actor.h @@ -235,7 +235,6 @@ void actBurnSprite(DBloodActor* pSource, DBloodActor* pTarget, int nTime); int actGetRespawnTime(DBloodActor *pSprite); bool actCheckRespawn(DBloodActor *pSprite); -bool actCanSplatWall(int nWall); void actFireVector(DBloodActor *pShooter, int a2, int a3, int a4, int a5, int a6, VECTOR_TYPE vectorType); void actPostSprite(DBloodActor* actor, int status); void actPostProcess(void); diff --git a/source/games/blood/src/db.h b/source/games/blood/src/db.h index 465cfd82c..d7fa8fd68 100644 --- a/source/games/blood/src/db.h +++ b/source/games/blood/src/db.h @@ -85,11 +85,6 @@ extern const char *gItemText[]; extern const char *gAmmoText[]; extern const char *gWeaponText[]; -static inline int GetWallType(int nWall) -{ - return wall[nWall].type; -} - template void GetSpriteExtents(T const * const pSprite, int *top, int *bottom) { *top = *bottom = pSprite->z; diff --git a/source/games/blood/src/mirrors.cpp b/source/games/blood/src/mirrors.cpp index 207f63031..c61c48f98 100644 --- a/source/games/blood/src/mirrors.cpp +++ b/source/games/blood/src/mirrors.cpp @@ -56,7 +56,7 @@ void InitMirrors(void) int nTile = 4080+mirrorcnt; if (pWalli->overpicnum == 504) { - if (pWalli->extra > 0 && GetWallType(i) == kWallStack) + if (pWalli->extra > 0 && pWalli->type == kWallStack) { pWalli->overpicnum = nTile; @@ -70,7 +70,7 @@ void InitMirrors(void) if (j == i) continue; auto pWallj = &wall[j]; - if (pWallj->extra > 0 && GetWallType(i) == kWallStack) + if (pWallj->extra > 0 && pWallj->type == kWallStack) { if (tmp != pWallj->xw().data) continue; diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index a4a0d5191..98e51c688 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -666,7 +666,6 @@ void OperateWall(walltype* pWall, EVENT event) { switch (pWall->type) { case kWallGib: - if (GetWallType(wallnum(pWall)) != pWall->type) break; bool bStatus; switch (event.cmd) { case kCmdOn: