Added new function RockOnMap.
This commit is contained in:
parent
c1f66a9c64
commit
9cc0ba3362
1 changed files with 22 additions and 0 deletions
|
@ -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.
|
||||
**
|
||||
|
|
Loading…
Add table
Reference in a new issue