summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-05-10 11:20:27 +0200
committeraap <aap@papnet.eu>2020-05-10 11:20:27 +0200
commit1b936f6ffbe71e2c44ef1a5b5d5e7a24801434c7 (patch)
tree42c2506c438da719dd82a007d7cd620c71ec1b4e /src/core
parentMerge branch 'miami' of github.com:GTAmodding/re3 into miami (diff)
downloadre3-1b936f6ffbe71e2c44ef1a5b5d5e7a24801434c7.tar
re3-1b936f6ffbe71e2c44ef1a5b5d5e7a24801434c7.tar.gz
re3-1b936f6ffbe71e2c44ef1a5b5d5e7a24801434c7.tar.bz2
re3-1b936f6ffbe71e2c44ef1a5b5d5e7a24801434c7.tar.lz
re3-1b936f6ffbe71e2c44ef1a5b5d5e7a24801434c7.tar.xz
re3-1b936f6ffbe71e2c44ef1a5b5d5e7a24801434c7.tar.zst
re3-1b936f6ffbe71e2c44ef1a5b5d5e7a24801434c7.zip
Diffstat (limited to '')
-rw-r--r--src/core/World.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/World.cpp b/src/core/World.cpp
index 29505481..3e07721a 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -382,7 +382,11 @@ CWorld::ProcessVerticalLine(const CVector &point1, float z2, CColPoint &point, C
{
AdvanceCurrentScanCode();
CVector point2(point1.x, point1.y, z2);
- return ProcessVerticalLineSector(*GetSector(GetSectorIndexX(point1.x), GetSectorIndexY(point1.y)),
+ int secX = GetSectorIndexX(point1.x);
+ int secY = GetSectorIndexY(point1.y);
+ secX = clamp(secX, 0, NUMSECTORS_X-1);
+ secY = clamp(secY, 0, NUMSECTORS_Y-1);
+ return ProcessVerticalLineSector(*GetSector(secX, secY),
CColLine(point1, point2), point, entity, checkBuildings, checkVehicles,
checkPeds, checkObjects, checkDummies, ignoreSeeThrough, poly);
}