diff options
author | jonas <himself@jonasgunz.de> | 2019-01-07 16:41:05 +0100 |
---|---|---|
committer | jonas <himself@jonasgunz.de> | 2019-01-07 16:41:05 +0100 |
commit | 096ae14001679bf28c2683e6d0292597b1f85910 (patch) | |
tree | 47a0e81ecba7a29ec8616dc886b06d9648847c25 | |
parent | c43504759393ddf6b74feef28b6a714b34715b59 (diff) | |
download | termgl-096ae14001679bf28c2683e6d0292597b1f85910.tar.gz |
Fixed SegFault when building HitMap of Objects outside of screenstable
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | cObjectHandler.cpp | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -1,2 +1,3 @@ *.o +build/* bin/* 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 |