diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-07-15 20:14:02 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-07-15 20:14:02 +0000 |
| commit | 07313c21e4de57b1ff91b4982d9654fc65959dc9 (patch) | |
| tree | d3556de4cd7395d1827e80e1d98834d8a9b8d66c /src/base | |
| parent | 4429770831c6fa590ab015586c4fdd9bcecba9fc (diff) | |
- prvy prototip novej AI
git-svn-id: http://opensvn.csie.org/tuxanci_ng@147 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/base')
| -rw-r--r-- | src/base/arena.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/base/arena.c b/src/base/arena.c index 2fe18b7..2b4821c 100644 --- a/src/base/arena.c +++ b/src/base/arena.c @@ -71,6 +71,11 @@ int conflictSpace(int x1,int y1,int w1,int h1,int x2,int y2,int w2,int h2) int isFreeSpace(arena_t *arena, int x, int y, int w, int h) { + if( x < 0 || y < 0 || x+w > arena->w || y+h > arena->h ) + { + return 0; + } + if( isConflictWithObjectFromSpace(arena->spaceTux, x, y, w, h) )return 0; if( isConflictWithObjectFromSpace(arena->spaceShot, x, y, w, h) )return 0; if( isConflictWithObjectFromSpace(arena->spaceItem, x, y, w, h) )return 0; |