From aa4de5dfa66533be42478ec2526307a46e1fc9c6 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Fri, 4 Aug 2006 07:24:51 +0000 Subject: Fixed Player ID in messages. --- ChangeLog | 1 + src/state.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b4504c1b..9fabdc64 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * src/object.h, src/object.cpp, src/being.h, src/dalstorage.cpp: Added the database primary key to Player. + * src/state.cpp: Used Player ID. 2006-08-03 Guillaume Melquiond diff --git a/src/state.cpp b/src/state.cpp index 53ddb7ac..ae3ceda4 100644 --- a/src/state.cpp +++ b/src/state.cpp @@ -64,7 +64,7 @@ void State::addObject(ObjectPtr objectPtr) { MessageOut msg; msg.writeShort(GPMSG_BEING_ENTER); msg.writeByte(OBJECT_PLAYER); - msg.writeLong(0); // ID + msg.writeLong(playerPtr->getID()); msg.writeString(playerPtr->getName()); msg.writeByte(playerPtr->getHairStyle()); msg.writeByte(playerPtr->getHairColor()); @@ -93,7 +93,7 @@ void State::removeObject(ObjectPtr objectPtr) { MessageOut msg; msg.writeShort(GPMSG_BEING_LEAVE); msg.writeByte(OBJECT_PLAYER); - msg.writeLong(0); // ID + msg.writeLong(playerPtr->getID()); Players::iterator p_end = players.end(), j = p_end; for (Players::iterator p = players.begin(); p != p_end; ++p) { if (p->get() == playerPtr.get()) @@ -114,7 +114,7 @@ void State::informPlayer(PlayerPtr playerPtr) { MessageOut msg; msg.writeShort(GPMSG_BEING_ENTER); msg.writeByte(OBJECT_PLAYER); - msg.writeLong(0); // ID + msg.writeLong((*p)->getID()); msg.writeString((*p)->getName()); msg.writeByte((*p)->getHairStyle()); msg.writeByte((*p)->getHairColor()); -- cgit v1.2.3-70-g09d2