forked from teamnwah/openmw-tes3coop
[Server] Actually, turn SetAttributeModifier into ClearAttributeModifier
There's no way SetAttributeModifier() was going to make sense if, say, a player had drunk 3 different potions fortifying the same attribute and was wearing equipment fortifying it as well. How would one change the sum modifier of those while accounting for each specific effect's duration and magnitude? The only workable solution is to allow the server to clear the modifier.
This commit is contained in:
parent
ef6dc61797
commit
2944be18ae
2 changed files with 4 additions and 4 deletions
|
@ -431,7 +431,7 @@ void StatsFunctions::SetAttributeBase(unsigned short pid, unsigned short attribu
|
||||||
player->creatureStats.mAttributes[attribute].mBase = value;
|
player->creatureStats.mAttributes[attribute].mBase = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StatsFunctions::SetAttributeModifier(unsigned short pid, unsigned short attribute, int value) noexcept
|
void StatsFunctions::ClearAttributeModifier(unsigned short pid, unsigned short attribute) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player,);
|
GET_PLAYER(pid, player,);
|
||||||
|
@ -439,7 +439,7 @@ void StatsFunctions::SetAttributeModifier(unsigned short pid, unsigned short att
|
||||||
if (attribute >= Attribute::Length)
|
if (attribute >= Attribute::Length)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
player->creatureStats.mAttributes[attribute].mMod = value;
|
player->creatureStats.mAttributes[attribute].mMod = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StatsFunctions::SetSkillBase(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
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
{"SetFatigueCurrent", StatsFunctions::SetFatigueCurrent},\
|
{"SetFatigueCurrent", StatsFunctions::SetFatigueCurrent},\
|
||||||
\
|
\
|
||||||
{"SetAttributeBase", StatsFunctions::SetAttributeBase},\
|
{"SetAttributeBase", StatsFunctions::SetAttributeBase},\
|
||||||
{"SetAttributeModifier", StatsFunctions::SetAttributeModifier},\
|
{"ClearAttributeModifier", StatsFunctions::ClearAttributeModifier},\
|
||||||
\
|
\
|
||||||
{"SetSkillBase", StatsFunctions::SetSkillBase},\
|
{"SetSkillBase", StatsFunctions::SetSkillBase},\
|
||||||
{"SetSkillCurrent", StatsFunctions::SetSkillCurrent},\
|
{"SetSkillCurrent", StatsFunctions::SetSkillCurrent},\
|
||||||
|
@ -141,7 +141,7 @@ public:
|
||||||
static void SetFatigueCurrent(unsigned short pid, double value) noexcept;
|
static void SetFatigueCurrent(unsigned short pid, double value) noexcept;
|
||||||
|
|
||||||
static void SetAttributeBase(unsigned short pid, unsigned short attribute, int value) noexcept;
|
static void SetAttributeBase(unsigned short pid, unsigned short attribute, int value) noexcept;
|
||||||
static void SetAttributeModifier(unsigned short pid, unsigned short attribute, int value) noexcept;
|
static void ClearAttributeModifier(unsigned short pid, unsigned short attribute) noexcept;
|
||||||
|
|
||||||
static void SetSkillBase(unsigned short pid, unsigned short skill, int value) noexcept;
|
static void SetSkillBase(unsigned short pid, unsigned short skill, int value) noexcept;
|
||||||
static void SetSkillCurrent(unsigned short pid, unsigned short skill, int value) noexcept;
|
static void SetSkillCurrent(unsigned short pid, unsigned short skill, int value) noexcept;
|
||||||
|
|
Loading…
Reference in a new issue