From 783aacf002d7f01d1be0ee46e4f42e8c31632c2e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 10 Sep 2014 21:13:14 +0300 Subject: In party handler in changeLeader accept player nick. --- src/net/eathena/partyhandler.cpp | 4 +++- src/net/eathena/partyhandler.h | 2 +- src/net/partyhandler.h | 2 +- src/net/tmwa/partyhandler.cpp | 2 +- src/net/tmwa/partyhandler.h | 3 ++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp index 4ea0e83ea..182ea4957 100644 --- a/src/net/eathena/partyhandler.cpp +++ b/src/net/eathena/partyhandler.cpp @@ -445,8 +445,10 @@ void PartyHandler::processPartyInviteResponse(Net::MessageIn &msg) const } } -void PartyHandler::changeLeader(const Being *const being) const +void PartyHandler::changeLeader(const std::string &name) const { + const Being *const being = actorManager->findBeingByName( + name, ActorType::PLAYER); if (!being) return; MessageOut outMsg(CMSG_PARTY_CHANGE_LEADER); diff --git a/src/net/eathena/partyhandler.h b/src/net/eathena/partyhandler.h index 16fa690bf..9459d0328 100644 --- a/src/net/eathena/partyhandler.h +++ b/src/net/eathena/partyhandler.h @@ -61,7 +61,7 @@ class PartyHandler final : public MessageHandler, public Ea::PartyHandler void setShareItems(const Net::PartyShare::Type share) const override final; - void changeLeader(const Being *const being) const override final; + void changeLeader(const std::string &name) const override final; void processPartySettings(Net::MessageIn &msg); diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h index 393d812fb..3f9825eec 100644 --- a/src/net/partyhandler.h +++ b/src/net/partyhandler.h @@ -70,7 +70,7 @@ class PartyHandler notfinal virtual void setShareItems(const Net::PartyShare::Type share) const = 0; - virtual void changeLeader(const Being *const being) const = 0; + virtual void changeLeader(const std::string &name) const = 0; virtual void clear() const = 0; diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index bbf74a099..ba3a4d26c 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -375,7 +375,7 @@ void PartyHandler::processPartyInviteResponse(Net::MessageIn &msg) const } } -void PartyHandler::changeLeader(const Being *const being A_UNUSED) const +void PartyHandler::changeLeader(const std::string &name A_UNUSED) const { } diff --git a/src/net/tmwa/partyhandler.h b/src/net/tmwa/partyhandler.h index f81c97eed..881f3cf3e 100644 --- a/src/net/tmwa/partyhandler.h +++ b/src/net/tmwa/partyhandler.h @@ -61,7 +61,8 @@ class PartyHandler final : public MessageHandler, public Ea::PartyHandler void setShareItems(const Net::PartyShare::Type share) const override final; - void changeLeader(const Being *const being) const override final; + void changeLeader(const std::string &name) const override final; + protected: void processPartySettings(Net::MessageIn &msg); -- cgit v1.2.3-70-g09d2