1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-21 12:53:51 +00:00

Fix script functions for setting dynamic stats

This commit is contained in:
David Cernat 2016-09-28 16:40:19 +03:00
parent 433190d82e
commit 458bdf4dff
2 changed files with 31 additions and 33 deletions

View file

@ -137,7 +137,7 @@ void StatsFunctions::SetIsMale(unsigned short pid, int value) noexcept
int StatsFunctions::GetLevel(unsigned short pid) noexcept int StatsFunctions::GetLevel(unsigned short pid) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0.f); GET_PLAYER(pid, player, 0.0f);
return player->CreatureStats()->mLevel; return player->CreatureStats()->mLevel;
} }
@ -150,15 +150,15 @@ void StatsFunctions::SetLevel(unsigned short pid, int value) noexcept
player->CreatureStats()->mLevel = value; player->CreatureStats()->mLevel = value;
} }
float StatsFunctions::GetHealthBase(unsigned short pid) noexcept double StatsFunctions::GetHealthBase(unsigned short pid) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player,0.f); GET_PLAYER(pid, player, 0.0f);
return player->CreatureStats()->mDynamic[0].mBase; return player->CreatureStats()->mDynamic[0].mBase;
} }
void StatsFunctions::SetHealthBase(unsigned short pid, float value) noexcept void StatsFunctions::SetHealthBase(unsigned short pid, double value) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player,); GET_PLAYER(pid, player,);
@ -166,15 +166,15 @@ void StatsFunctions::SetHealthBase(unsigned short pid, float value) noexcept
player->CreatureStats()->mDynamic[0].mBase = value; player->CreatureStats()->mDynamic[0].mBase = value;
} }
float StatsFunctions::GetHealthCurrent(unsigned short pid) noexcept double StatsFunctions::GetHealthCurrent(unsigned short pid) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0.f); GET_PLAYER(pid, player, 0.0f);
return player->CreatureStats()->mDynamic[0].mCurrent; return player->CreatureStats()->mDynamic[0].mCurrent;
} }
void StatsFunctions::SetHealthCurrent(unsigned short pid, float value) noexcept void StatsFunctions::SetHealthCurrent(unsigned short pid, double value) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player,); GET_PLAYER(pid, player,);
@ -182,15 +182,15 @@ void StatsFunctions::SetHealthCurrent(unsigned short pid, float value) noexcept
player->CreatureStats()->mDynamic[0].mCurrent = 0; player->CreatureStats()->mDynamic[0].mCurrent = 0;
} }
float StatsFunctions::GetMagickaBase(unsigned short pid) noexcept double StatsFunctions::GetMagickaBase(unsigned short pid) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player,0.f); GET_PLAYER(pid, player, 0.0f);
return player->CreatureStats()->mDynamic[1].mBase; return player->CreatureStats()->mDynamic[1].mBase;
} }
void StatsFunctions::SetMagickaBase(unsigned short pid, float value) noexcept void StatsFunctions::SetMagickaBase(unsigned short pid, double value) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player,); GET_PLAYER(pid, player,);
@ -198,15 +198,15 @@ void StatsFunctions::SetMagickaBase(unsigned short pid, float value) noexcept
player->CreatureStats()->mDynamic[1].mBase = value; player->CreatureStats()->mDynamic[1].mBase = value;
} }
float StatsFunctions::GetMagickaCurrent(unsigned short pid) noexcept double StatsFunctions::GetMagickaCurrent(unsigned short pid) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0.f); GET_PLAYER(pid, player, 0.0f);
return player->CreatureStats()->mDynamic[1].mCurrent; return player->CreatureStats()->mDynamic[1].mCurrent;
} }
void StatsFunctions::SetMagickaCurrent(unsigned short pid, float value) noexcept void StatsFunctions::SetMagickaCurrent(unsigned short pid, double value) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player,); GET_PLAYER(pid, player,);
@ -214,15 +214,15 @@ void StatsFunctions::SetMagickaCurrent(unsigned short pid, float value) noexcept
player->CreatureStats()->mDynamic[1].mCurrent = 0; player->CreatureStats()->mDynamic[1].mCurrent = 0;
} }
float StatsFunctions::GetFatigueBase(unsigned short pid) noexcept double StatsFunctions::GetFatigueBase(unsigned short pid) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player,0.f); GET_PLAYER(pid, player, 0.0f);
return player->CreatureStats()->mDynamic[2].mBase; return player->CreatureStats()->mDynamic[2].mBase;
} }
void StatsFunctions::SetFatigueBase(unsigned short pid, float value) noexcept void StatsFunctions::SetFatigueBase(unsigned short pid, double value) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player,); GET_PLAYER(pid, player,);
@ -230,15 +230,15 @@ void StatsFunctions::SetFatigueBase(unsigned short pid, float value) noexcept
player->CreatureStats()->mDynamic[2].mBase = value; player->CreatureStats()->mDynamic[2].mBase = value;
} }
float StatsFunctions::GetFatigueCurrent(unsigned short pid) noexcept double StatsFunctions::GetFatigueCurrent(unsigned short pid) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, 0.f); GET_PLAYER(pid, player, 0.0f);
return player->CreatureStats()->mDynamic[2].mCurrent; return player->CreatureStats()->mDynamic[2].mCurrent;
} }
void StatsFunctions::SetFatigueCurrent(unsigned short pid, float value) noexcept void StatsFunctions::SetFatigueCurrent(unsigned short pid, double value) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player,); GET_PLAYER(pid, player,);
@ -362,8 +362,6 @@ void StatsFunctions::SetSkillBase(unsigned short pid, unsigned short skill, int
return; return;
player->NpcStats()->mSkills[skill].mBase = value; player->NpcStats()->mSkills[skill].mBase = value;
//DEBUG_PRINTF("SetSkill(%d, %d, %d)\n", pid, skill, value);
} }
int StatsFunctions::GetSkillCurrent(unsigned short pid, unsigned short skill) noexcept int StatsFunctions::GetSkillCurrent(unsigned short pid, unsigned short skill) noexcept

View file

@ -94,20 +94,20 @@ public:
static int GetLevel(unsigned short pid) noexcept; static int GetLevel(unsigned short pid) noexcept;
static void SetLevel(unsigned short pid, int value) noexcept; static void SetLevel(unsigned short pid, int value) noexcept;
static float GetHealthBase(unsigned short pid) noexcept; static double GetHealthBase(unsigned short pid) noexcept;
static void SetHealthBase(unsigned short pid, float value) noexcept; static void SetHealthBase(unsigned short pid, double value) noexcept;
static float GetHealthCurrent(unsigned short pid) noexcept; static double GetHealthCurrent(unsigned short pid) noexcept;
static void SetHealthCurrent(unsigned short pid, float value) noexcept; static void SetHealthCurrent(unsigned short pid, double value) noexcept;
static float GetMagickaBase(unsigned short pid) noexcept; static double GetMagickaBase(unsigned short pid) noexcept;
static void SetMagickaBase(unsigned short pid, float value) noexcept; static void SetMagickaBase(unsigned short pid, double value) noexcept;
static float GetMagickaCurrent(unsigned short pid) noexcept; static double GetMagickaCurrent(unsigned short pid) noexcept;
static void SetMagickaCurrent(unsigned short pid, float value) noexcept; static void SetMagickaCurrent(unsigned short pid, double value) noexcept;
static float GetFatigueBase(unsigned short pid) noexcept; static double GetFatigueBase(unsigned short pid) noexcept;
static void SetFatigueBase(unsigned short pid, float value) noexcept; static void SetFatigueBase(unsigned short pid, double value) noexcept;
static float GetFatigueCurrent(unsigned short pid) noexcept; static double GetFatigueCurrent(unsigned short pid) noexcept;
static void SetFatigueCurrent(unsigned short pid, float value) noexcept; static void SetFatigueCurrent(unsigned short pid, double value) noexcept;
static int GetAttributeCount() noexcept; static int GetAttributeCount() noexcept;
static int GetSkillCount() noexcept; static int GetSkillCount() noexcept;