--- deliantra/server/include/map.h 2008/08/11 23:23:41 1.97 +++ deliantra/server/include/map.h 2008/08/17 22:46:26 1.98 @@ -85,7 +85,7 @@ */ #define P_BLOCKSVIEW 0x01 #define P_NO_MAGIC 0x02 /* Spells (some) can't pass this object */ -//#define P_PLAYER 0x04 /* a player (or something seeing these objects) is on this mapspace */ +#define P_PLAYER 0x04 /* a player (or something seeing these objects) is on this mapspace */ #define P_SAFE 0x08 /* If this is set the map tile is a safe space, * that means, nothing harmful can be done, * such as: bombs, potion usage, alchemy, spells @@ -140,8 +140,15 @@ MTH object *player () { - // this assumes that players are always on top - return top && top->type == PLAYER ? top : 0; + object *op; + + if (flags () & P_PLAYER) + for (op = top; op->type != PLAYER; op = op->below) + ; + else + op = 0; + + return op; } // return the item volume on this mapspace in cm³