diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/manaserv_protocol.h | 1 | ||||
-rw-r--r-- | src/game-server/abilitycomponent.h | 7 | ||||
-rw-r--r-- | src/game-server/state.cpp | 11 |
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()) { |