summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2013-09-08 20:35:36 +0200
committerErik Schilling <ablu.erikschilling@googlemail.com>2013-09-08 20:35:36 +0200
commit54389afd7ba9fecf0761333185145e968e2453ae (patch)
treeee3450aaa10e603ecb36ce47fa437626f550f116 /src
parent05fc955a3f8a03539088fa7569395434e29d90e8 (diff)
downloadmanaserv-54389afd7ba9fecf0761333185145e968e2453ae.tar.gz
manaserv-54389afd7ba9fecf0761333185145e968e2453ae.tar.bz2
manaserv-54389afd7ba9fecf0761333185145e968e2453ae.tar.xz
manaserv-54389afd7ba9fecf0761333185145e968e2453ae.zip
Actually send the info about beings using direction abilities
Diffstat (limited to 'src')
-rw-r--r--src/common/manaserv_protocol.h1
-rw-r--r--src/game-server/abilitycomponent.h7
-rw-r--r--src/game-server/state.cpp11
3 files changed, 18 insertions, 1 deletions
diff --git a/src/common/manaserv_protocol.h b/src/common/manaserv_protocol.h
index 312fdb59..b34a99ec 100644
--- a/src/common/manaserv_protocol.h
+++ b/src/common/manaserv_protocol.h
@@ -145,6 +145,7 @@ enum {
GPMSG_ITEMS = 0x0281, // { W item id, W*2 position }*
GPMSG_BEING_ABILITY_POINT = 0x0282, // W being id, B abilityId, W*2 point
GPMSG_BEING_ABILITY_BEING = 0x0283, // W being id, B abilityId, W target being id
+ GPMSG_BEING_ABILITY_DIRECTION = 0x0284, // W being id, B abilityId, B direction
PGMSG_USE_ABILITY_ON_BEING = 0x0290, // B abilityID, W being id
PGMSG_USE_ABILITY_ON_POINT = 0x0291, // B abilityID, W*2 position
PGMSG_USE_ABILITY_ON_DIRECTION = 0x0292, // B abilityID, B direction
diff --git a/src/game-server/abilitycomponent.h b/src/game-server/abilitycomponent.h
index 5814a4ae..26a9b138 100644
--- a/src/game-server/abilitycomponent.h
+++ b/src/game-server/abilitycomponent.h
@@ -85,7 +85,7 @@ public:
int getLastTargetBeingId() const;
const Point &getLastTargetPoint() const;
- ManaServ::BeingDirection getLastUsedTargetDirection() const;
+ ManaServ::BeingDirection getLastTargetDirection() const;
private:
bool abilityUseCheck(AbilityMap::iterator it);
@@ -151,4 +151,9 @@ inline int AbilityComponent::getLastTargetBeingId() const
return mLastTargetBeingId;
}
+inline ManaServ::BeingDirection AbilityComponent::getLastTargetDirection() const
+{
+ return mLastTargetDirection;
+}
+
#endif /* ABILITYCOMPONENT_H_ */
diff --git a/src/game-server/state.cpp b/src/game-server/state.cpp
index b6528955..4db5caab 100644
--- a/src/game-server/state.cpp
+++ b/src/game-server/state.cpp
@@ -229,6 +229,17 @@ static void informPlayer(MapComposite *map, Entity *p)
gameHandler->sendTo(p, abilityMsg);
}
+ if (oflags & UPDATEFLAG_ABILITY_ON_DIRECTION)
+ {
+ MessageOut abilityMsg(GPMSG_BEING_ABILITY_DIRECTION);
+ abilityMsg.writeInt16(oid);
+ auto *abilityComponent = o->getComponent<AbilityComponent>();
+ abilityMsg.writeInt8(abilityComponent->getLastUsedAbilityId());
+ abilityMsg.writeInt8(
+ abilityComponent->getLastTargetDirection());
+ gameHandler->sendTo(p, abilityMsg);
+ }
+
// Send damage messages.
if (o->canFight())
{