From 9cc0ba3362037d73244aa4d7a80fb08e184ee79c Mon Sep 17 00:00:00 2001 From: johns <> Date: Mon, 26 Feb 2001 21:33:10 +0000 Subject: [PATCH] Added new function RockOnMap. --- src/map/map.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/map/map.cpp b/src/map/map.cpp index 057db3169..36c56ab43 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -279,6 +279,28 @@ global int ForestOnMap(int tx,int ty) return TheMap.Fields[tx+ty*TheMap.Width].Flags&MapFieldForest; } +/** +** Rock on map tile. +** +** @param x X map tile position. +** @param y Y map tile position. +** +** @return True if rock, false otherwise. +*/ +global int RockOnMap(int tx,int ty) +{ + IfDebug( + if( tx<0 || ty<0 || tx>=TheMap.Width || ty>=TheMap.Height ) { + // FIXME: must cleanup calling function ! + fprintf(stderr,"Used x %d, y %d\n",tx,ty); + abort(); + return 0; + } + ); + + return TheMap.Fields[tx+ty*TheMap.Width].Flags&MapFieldRock; +} + /** ** Can move to this point, applying mask. **