diff --git a/source/games/sw/src/sector.cpp b/source/games/sw/src/sector.cpp index 0c58806a4..a7d4b15c0 100644 --- a/source/games/sw/src/sector.cpp +++ b/source/games/sw/src/sector.cpp @@ -663,77 +663,6 @@ void DoSpringBoardDown(void) return; } -short FindSectorByTag(int x, int y, int tag) -{ - short i = 0, near_sector = -1; - int diff, near_diff = 9999999; - short wallnum; - - for (i = 0; i < numsectors; i++) - { - if (sector[i].lotag == tag) - { - // get the delta of the door/elevator - wallnum = sector[i].wallptr; - - // diff = labs(wall[wallnum].x - x) + labs(wall[wallnum].y - y); - diff = Distance(wall[wallnum].x, wall[wallnum].y, x, y); - - // if the door/elevator is closer than the last save it off - if (diff < near_diff) - { - near_diff = diff; - near_sector = i; - } - } - } - - return near_sector; - -} - -short FindSectorByTag_Wall(short wallnum, int tag) -{ - return FindSectorByTag(wall[wallnum].x, wall[wallnum].y, tag); -} - -short FindSectorByTag_Sprite(short SpriteNum, int tag) -{ - return FindSectorByTag(sprite[SpriteNum].x, sprite[SpriteNum].y, tag); -} - -short FindSectorMidByTag(short sectnum, int tag) -{ - short i = 0, near_sector = -1; - int diff, near_diff = 9999999, x, y; - int trash, fx, fy; - - // Get the mid x,y of the sector - SectorMidPoint(sectnum, &x, &y, &trash); - - for (i = 0; i < numsectors; i++) - { - if (sector[i].lotag == tag) - { - // get the delta of the door/elevator - SectorMidPoint(i, &fx, &fy, &trash); - - // diff = labs(wall[wallnum].x - x) + labs(wall[wallnum].y - y); - diff = Distance(fx, fy, x, y); - - // if the door/elevator is closer than the last save it off - if (diff < near_diff) - { - near_diff = diff; - near_sector = i; - } - } - } - - return near_sector; - -} - short FindNextSectorByTag(short sectnum, int tag) { short next_sectnum, startwall, endwall, j;