From efc1bde7fb961c2c5f22c904912cd1e7055815d9 Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Sun, 14 Apr 2013 23:16:09 +0200 Subject: [Abilities] Added network message for removed ability This prevents really nasty code clientside --- src/common/manaserv_protocol.h | 1 + src/game-server/character.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/common/manaserv_protocol.h b/src/common/manaserv_protocol.h index 5649999..05e5fd5 100644 --- a/src/common/manaserv_protocol.h +++ b/src/common/manaserv_protocol.h @@ -148,6 +148,7 @@ enum { PGMSG_USE_ABILITY_ON_BEING = 0x0292, // B abilityID, W being id GPMSG_ABILITY_STATUS = 0x0293, // { B abilityID, D current, D max, D recharge } PGMSG_USE_ABILITY_ON_POINT = 0x0294, // B abilityID, W*2 position + GPMSG_ABILITY_REMOVED = 0x0295, // B abilityID PGMSG_SAY = 0x02A0, // S text GPMSG_SAY = 0x02A1, // W being id, S text GPMSG_NPC_CHOICE = 0x02B0, // W being id, { S text }* diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp index 25b9fbd..d9462ca 100644 --- a/src/game-server/character.cpp +++ b/src/game-server/character.cpp @@ -731,7 +731,9 @@ bool CharacterComponent::takeAbility(int id) if (i != mAbilities.end()) { mAbilities.erase(i); - mAbilitiesUpdateNeeded = true; + MessageOut msg(GPMSG_ABILITY_REMOVED); + msg.writeInt8(id); + gameHandler->sendTo(mClient, msg); return true; } return false; -- cgit