While reading some older posts, I found
this topic again. I remembered seeing something like that mentioned by AmIMeYet somewhere, so i searched the SDK and was surprised to actually find it:
// OP2Helper.h
#define MkXY(x,y) (LOCATION(x+31,y-1))
#define MkRect(x1,y1,x2,y2) (MAP_RECT(LOCATION(x1+31,y1-1),LOCATION(x2+31,y2-1)))
#define XYPos(x,y) x+31,y-1
#define RectPos(x1,y1,x2,y2) x1+31,y1-1,x2+31,y2-1
Maybe someone put it in there and forgot about it? However, AmIMeYet's suggestion to make it compatible for world maps is worth a thought. It could easily be done by replacing it by
#ifdef WORLDMAP
#define MkXY(x,y) (LOCATION(x-1,y-1))
#define MkRect(x1,y1,x2,y2) (MAP_RECT(LOCATION(x1-1,y1-1),LOCATION(x2-1,y2-1)))
#define XYPos(x,y) x-1,y-1
#define RectPos(x1,y1,x2,y2) x1-1,y1-1,x2-1,y2-1
#else
#define MkXY(x,y) (LOCATION(x+31,y-1))
#define MkRect(x1,y1,x2,y2) (MAP_RECT(LOCATION(x1+31,y1-1),LOCATION(x2+31,y2-1)))
#define XYPos(x,y) x+31,y-1
#define RectPos(x1,y1,x2,y2) x1+31,y1-1,x2+31,y2-1
#endif
Whew! I can hear Hoomans blood running cold.