From e1d32bdbf564d400cbe0e179aa5c25d2e793c580 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 5 Jan 2022 09:22:00 +0100 Subject: [PATCH] - removed the error messages in GetOverlapSector(2). These can actually be triggered in legitimate scenarios by hitscans so just returning 0 looks like the best way of handling it. --- source/games/sw/src/player.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index a38812346..85f72c1db 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -3866,10 +3866,11 @@ int GetOverlapSector(int x, int y, sectortype** over, sectortype** under) if (!found) { - I_Error("GetOverlapSector x = %d, y = %d, over %d, under %d", x, y, sectnum(*over), sectnum(*under)); + // Contrary to expectations, this *CAN* happen in valid scenarios and therefore should not abort. + //I_Error("GetOverlapSector x = %d, y = %d, over %d, under %d", x, y, sectnum(*over), sectnum(*under)); + return 0; } - PRODUCTION_ASSERT(found != 0); PRODUCTION_ASSERT(found <= 2); // the are overlaping - check the z coord @@ -3955,10 +3956,11 @@ int GetOverlapSector2(int x, int y, sectortype** over, sectortype** under) if (!found) { - I_Error("GetOverlapSector2 x = %d, y = %d, over %d, under %d", x, y, sectnum(*over), sectnum(*under)); + // Contrary to expectations, this *CAN* happen in valid scenarios and therefore should not abort. + //I_Error("GetOverlapSector2 x = %d, y = %d, over %d, under %d", x, y, sectnum(*over), sectnum(*under)); + return 0; } - PRODUCTION_ASSERT(found != 0); PRODUCTION_ASSERT(found <= 2); // the are overlaping - check the z coord