From 42f48a3b17f4b3301f08822b33b24a2611821566 Mon Sep 17 00:00:00 2001 From: btd Date: Sat, 21 Aug 2010 10:40:03 +0400 Subject: [PATCH] Add Checks. Koule XII loaded --- src/game/collision.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/game/collision.cpp b/src/game/collision.cpp index 016d9a456..ca0a59c44 100644 --- a/src/game/collision.cpp +++ b/src/game/collision.cpp @@ -182,7 +182,9 @@ int CCollision::GetTile(int x, int y) return 0; } int CCollision::Entity(int x, int y, bool Front) -{ +{ + if(0 < x || x >= m_Width) return 0; + if(0 < y || y >= m_Height) return 0; int Index = Front?m_pFront[y*m_Width+x].m_Index:m_pTiles[y*m_Width+x].m_Index; return Index-ENTITY_OFFSET; }