From 295f486a97bd6bbd2b7ba9e99493656057422108 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Wed, 28 Sep 2016 02:19:39 +0300 Subject: [PATCH] Using less confusing names for server stat functions, part 2 --- apps/openmw-mp/Script/Functions/Stats.cpp | 8 ++++---- apps/openmw-mp/Script/Functions/Stats.hpp | 19 ++++++++----------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/apps/openmw-mp/Script/Functions/Stats.cpp b/apps/openmw-mp/Script/Functions/Stats.cpp index df4df174a..53fabf6ef 100644 --- a/apps/openmw-mp/Script/Functions/Stats.cpp +++ b/apps/openmw-mp/Script/Functions/Stats.cpp @@ -298,7 +298,7 @@ const char *StatsFunctions::GetSkillName(unsigned short skill) noexcept return Skill::sSkillNames[skill].c_str(); } -int StatsFunctions::GetAttribute(unsigned short pid, unsigned short attribute) noexcept +int StatsFunctions::GetAttributeBase(unsigned short pid, unsigned short attribute) noexcept { Player *player; GET_PLAYER(pid, player, 0); @@ -309,7 +309,7 @@ int StatsFunctions::GetAttribute(unsigned short pid, unsigned short attribute) n return player->CreatureStats()->mAttributes[attribute].mBase; } -void StatsFunctions::SetAttribute(unsigned short pid, unsigned short attribute, int value) noexcept +void StatsFunctions::SetAttributeBase(unsigned short pid, unsigned short attribute, int value) noexcept { Player *player; GET_PLAYER(pid, player,); @@ -342,7 +342,7 @@ void StatsFunctions::SetAttributeCurrent(unsigned short pid, unsigned short attr player->CreatureStats()->mAttributes[attribute].mCurrent = value; } -int StatsFunctions::GetSkill(unsigned short pid, unsigned short skill) noexcept +int StatsFunctions::GetSkillBase(unsigned short pid, unsigned short skill) noexcept { Player *player; GET_PLAYER(pid, player, 0); @@ -353,7 +353,7 @@ int StatsFunctions::GetSkill(unsigned short pid, unsigned short skill) noexcept return player->NpcStats()->mSkills[skill].mBase; } -void StatsFunctions::SetSkill(unsigned short pid, unsigned short skill, int value) noexcept //TODO: need packet for one value +void StatsFunctions::SetSkillBase(unsigned short pid, unsigned short skill, int value) noexcept //TODO: need packet for one value { Player *player; GET_PLAYER(pid, player,); diff --git a/apps/openmw-mp/Script/Functions/Stats.hpp b/apps/openmw-mp/Script/Functions/Stats.hpp index 8f4a83342..1cf6738a5 100644 --- a/apps/openmw-mp/Script/Functions/Stats.hpp +++ b/apps/openmw-mp/Script/Functions/Stats.hpp @@ -34,12 +34,12 @@ {"GetAttributeName", StatsFunctions::GetAttributeName},\ {"GetSkillName", StatsFunctions::GetSkillName},\ \ - {"GetAttribute", StatsFunctions::GetAttribute},\ - {"SetAttribute", StatsFunctions::SetAttribute},\ + {"GetAttributeBase", StatsFunctions::GetAttributeBase},\ + {"SetAttributeBase", StatsFunctions::SetAttributeBase},\ {"GetAttributeCurrent", StatsFunctions::GetAttributeCurrent},\ {"SetAttributeCurrent", StatsFunctions::SetAttributeCurrent},\ - {"GetSkill", StatsFunctions::GetSkill},\ - {"SetSkill", StatsFunctions::SetSkill},\ + {"GetSkillBase", StatsFunctions::GetSkillBase},\ + {"SetSkillBase", StatsFunctions::SetSkillBase},\ {"GetSkillCurrent", StatsFunctions::GetSkillCurrent},\ {"SetSkillCurrent", StatsFunctions::SetSkillCurrent},\ \ @@ -81,9 +81,6 @@ public: static void SetRace(unsigned short pid, const char *race) noexcept; static const char *GetRace(unsigned short pid) noexcept; - static void SetClass(unsigned short pid, const char *name) noexcept; - static const char *GetClass(unsigned short pid) noexcept; - static void SetHead(unsigned short pid, const char *head) noexcept; static const char *GetHead(unsigned short pid) noexcept; @@ -118,13 +115,13 @@ public: static const char *GetAttributeName(unsigned short attribute) noexcept; static const char *GetSkillName(unsigned short skill) noexcept; - static int GetAttribute(unsigned short pid, unsigned short attribute) noexcept; - static void SetAttribute(unsigned short pid, unsigned short attribute, int value) noexcept; + static int GetAttributeBase(unsigned short pid, unsigned short attribute) noexcept; + static void SetAttributeBase(unsigned short pid, unsigned short attribute, int value) noexcept; static int GetAttributeCurrent(unsigned short pid, unsigned short attribute) noexcept; static void SetAttributeCurrent(unsigned short pid, unsigned short attribute, int value) noexcept; - static int GetSkill(unsigned short pid, unsigned short skill) noexcept; - static void SetSkill(unsigned short pid, unsigned short skill, int value) noexcept; + static int GetSkillBase(unsigned short pid, unsigned short skill) noexcept; + static void SetSkillBase(unsigned short pid, unsigned short skill, int value) noexcept; static int GetSkillCurrent(unsigned short pid, unsigned short skill) noexcept; static void SetSkillCurrent(unsigned short pid, unsigned short skill, int value) noexcept;