summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/defines.h1
-rw-r--r--src/game-server/state.cpp17
2 files changed, 15 insertions, 3 deletions
diff --git a/src/defines.h b/src/defines.h
index b6479d2..940f932 100644
--- a/src/defines.h
+++ b/src/defines.h
@@ -142,6 +142,7 @@ enum {
// player: S name, B hair style, B hair color, B gender
// monster: W type id
GPMSG_BEING_LEAVE = 0x0201, // W being id
+ GPMSG_ITEM_APPEAR = 0x0202, // W item id, W*2 position
PGMSG_WALK = 0x0260, // W*2 destination
GPMSG_BEINGS_MOVE = 0x0280, // { W being id, B flags [, C position] [, W*2 destination] }*
GPMSG_ITEMS = 0x0281, // { W item id, W*2 position }*
diff --git a/src/game-server/state.cpp b/src/game-server/state.cpp
index 9024374..2972bd0 100644
--- a/src/game-server/state.cpp
+++ b/src/game-server/state.cpp
@@ -216,9 +216,20 @@ void State::informPlayer(MapComposite *map, Player *p)
if (willBeInRange ^ wereInRange)
{
- itemMsg.writeShort(willBeInRange ? o->getItemClass()->getDatabaseID() : 0);
- itemMsg.writeShort(opos.x);
- itemMsg.writeShort(opos.y);
+ if (oflags & NEW_ON_MAP)
+ {
+ MessageOut appearMsg(GPMSG_ITEM_APPEAR);
+ appearMsg.writeShort(o->getItemClass()->getDatabaseID());
+ appearMsg.writeShort(opos.x);
+ appearMsg.writeShort(opos.y);
+ gameHandler->sendTo(p, appearMsg);
+ }
+ else
+ {
+ itemMsg.writeShort(willBeInRange ? o->getItemClass()->getDatabaseID() : 0);
+ itemMsg.writeShort(opos.x);
+ itemMsg.writeShort(opos.y);
+ }
}
}