From 35874b5fd2b55e92a5033524178aa3bbcabdf8d7 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Wed, 11 Nov 2020 12:27:40 +0300 Subject: fix --- src/core/World.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/World.h b/src/core/World.h index cfdafedd..be32db20 100644 --- a/src/core/World.h +++ b/src/core/World.h @@ -77,7 +77,7 @@ public: static void Remove(CEntity *entity); static void Add(CEntity *entity); - static CSector *GetSector(int x, int y) { if (x > NUMSECTORS_X || y > NUMSECTORS_Y) return &ms_aSectors[0][0]; return &ms_aSectors[y][x]; } + static CSector *GetSector(int x, int y) { if (x > NUMSECTORS_X - 1 || y > NUMSECTORS_Y - 1) return &ms_aSectors[0][0]; return &ms_aSectors[y][x]; } static CPtrList &GetBigBuildingList(eLevelName i) { return ms_bigBuildingsList[i]; } static CPtrList &GetMovingEntityList(void) { return ms_listMovingEntityPtrs; } static uint16 GetCurrentScanCode(void) { return ms_nCurrentScanCode; } -- cgit v1.2.3