From 7717f9becef931cb0543d0a6dfd29c06e0f5092e Mon Sep 17 00:00:00 2001 From: Koncord Date: Wed, 30 Aug 2017 13:56:22 +0800 Subject: [PATCH] [Server] Replace getKillRefId/getKillNumber with getKill --- apps/openmw-mp/Quests.cpp | 13 ++++--------- apps/openmw-mp/Quests.hpp | 3 +-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/apps/openmw-mp/Quests.cpp b/apps/openmw-mp/Quests.cpp index 4a767e8ac..7cffd80a8 100644 --- a/apps/openmw-mp/Quests.cpp +++ b/apps/openmw-mp/Quests.cpp @@ -80,8 +80,7 @@ void Quests::Init(LuaState &lua) "getJournalItem", &Quests::getJournalItem, "addKill", &Quests::addKill, - "getKillRefId", &Quests::getKillRefId, - "getKillNumber", &Quests::getKillNumber + "getKill", &Quests::getKill ); } @@ -150,12 +149,8 @@ void Quests::addKill(const std::string &refId, int number) changedKills = true; } -std::string Quests::getKillRefId(unsigned int i) const +std::tuple Quests::getKill(unsigned int i) const { - return player->killChanges.kills.at(i).refId; -} - -int Quests::getKillNumber(unsigned int i) const -{ - return player->killChanges.kills.at(i).number; + auto & kill = player->killChanges.kills.at(i); + return std::make_tuple(kill.refId, kill.number); } diff --git a/apps/openmw-mp/Quests.hpp b/apps/openmw-mp/Quests.hpp index eef3d0b1f..c71237664 100644 --- a/apps/openmw-mp/Quests.hpp +++ b/apps/openmw-mp/Quests.hpp @@ -52,8 +52,7 @@ public: JournalItem getJournalItem(unsigned int id); void addKill(const std::string &refId, int number); - std::string getKillRefId(unsigned int i) const; - int getKillNumber(unsigned int i) const; + std::tuple getKill(unsigned int i) const; private: Player *player;