From e8ce0095215992ad528d30f007d7cf99959c278b Mon Sep 17 00:00:00 2001 From: David Cernat Date: Thu, 5 Jul 2018 20:26:23 +0300 Subject: [PATCH] [Server] Use regular int as return value for GetObjectSummonerPid() Additionally, clarify descriptions of script functions for getting information about summoners. --- apps/openmw-mp/Script/Functions/Objects.cpp | 2 +- apps/openmw-mp/Script/Functions/Objects.hpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/openmw-mp/Script/Functions/Objects.cpp b/apps/openmw-mp/Script/Functions/Objects.cpp index de7fe0d80..a1a21dcde 100644 --- a/apps/openmw-mp/Script/Functions/Objects.cpp +++ b/apps/openmw-mp/Script/Functions/Objects.cpp @@ -128,7 +128,7 @@ bool ObjectFunctions::DoesObjectHavePlayerSummoner(unsigned int i) noexcept return readObjectList->baseObjects.at(i).master.isPlayer; } -unsigned int ObjectFunctions::GetObjectSummonerPid(unsigned int i) noexcept +int ObjectFunctions::GetObjectSummonerPid(unsigned int i) noexcept { Player *player = Players::getPlayer(readObjectList->baseObjects.at(i).master.guid); diff --git a/apps/openmw-mp/Script/Functions/Objects.hpp b/apps/openmw-mp/Script/Functions/Objects.hpp index d1037dc70..cc4289694 100644 --- a/apps/openmw-mp/Script/Functions/Objects.hpp +++ b/apps/openmw-mp/Script/Functions/Objects.hpp @@ -287,6 +287,7 @@ public: * * Only living actors can be summoned. * + * \param i The index of the object. * \return Whether a player is the summoner of the object. */ static bool DoesObjectHavePlayerSummoner(unsigned int i) noexcept; @@ -298,10 +299,10 @@ public: * \param i The index of the object. * \return The player ID of the summoner. */ - static unsigned int GetObjectSummonerPid(unsigned int i) noexcept; + static int GetObjectSummonerPid(unsigned int i) noexcept; /** - * \brief Get the refId of the summoner of the object at a certain index in the read object + * \brief Get the refId of the actor summoner of the object at a certain index in the read object * list's object changes. * * \param i The index of the object. @@ -310,7 +311,7 @@ public: static const char *GetObjectSummonerRefId(unsigned int i) noexcept; /** - * \brief Get the refNumIndex of the summoner of the object at a certain index in the read object + * \brief Get the refNumIndex of the actor summoner of the object at a certain index in the read object * list's object changes. * * \param i The index of the object. @@ -319,7 +320,7 @@ public: static int GetObjectSummonerRefNumIndex(unsigned int i) noexcept; /** - * \brief Get the mpNum of the summoner of the object at a certain index in the read object list's + * \brief Get the mpNum of the actor summoner of the object at a certain index in the read object list's * object changes. * * \param i The index of the object.