From 096ae14001679bf28c2683e6d0292597b1f85910 Mon Sep 17 00:00:00 2001 From: jonas Date: Mon, 7 Jan 2019 16:41:05 +0100 Subject: Fixed SegFault when building HitMap of Objects outside of screen --- cObjectHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cObjectHandler.cpp') diff --git a/cObjectHandler.cpp b/cObjectHandler.cpp index 0b4bb65..3b56e82 100644 --- a/cObjectHandler.cpp +++ b/cObjectHandler.cpp @@ -145,7 +145,7 @@ void cObjectHandler::buildHitmap() { for(int y = oPos.y; y <= oPos.y + oSize.y; y++) { - if(x < size.x && y < size.y) //Objects can be outside the screen. + if((x < size.x && y < size.y) && (x >= 0 && y >= 0)) //Objects can be outside the screen. iHitMap[x][y] = i; }//for }//for -- cgit v1.2.3