mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-22 12:18:27 +00:00
[Bug Fix] Fix Character EXP Modifiers default (#4161)
# Notes - The `-1.0f` was causing these modifiers to be set to `0.0` and when people would enable them they would get no experience. - We now use the zone based grabbed methods when setting which will default to a value of `1.0f` if there is not a value found.
This commit is contained in:
@@ -3165,6 +3165,11 @@ void Zone::ClearEXPModifier(Client* c)
|
||||
exp_modifiers.erase(c->CharacterID());
|
||||
}
|
||||
|
||||
void Zone::ClearEXPModifierByCharacterID(const uint32 character_id)
|
||||
{
|
||||
exp_modifiers.erase(character_id);
|
||||
}
|
||||
|
||||
float Zone::GetAAEXPModifier(Client* c)
|
||||
{
|
||||
const auto& l = exp_modifiers.find(c->CharacterID());
|
||||
@@ -3177,6 +3182,18 @@ float Zone::GetAAEXPModifier(Client* c)
|
||||
return v.aa_modifier;
|
||||
}
|
||||
|
||||
float Zone::GetAAEXPModifierByCharacterID(const uint32 character_id)
|
||||
{
|
||||
const auto& l = exp_modifiers.find(character_id);
|
||||
if (l == exp_modifiers.end()) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
const auto& v = l->second;
|
||||
|
||||
return v.aa_modifier;
|
||||
}
|
||||
|
||||
float Zone::GetEXPModifier(Client* c)
|
||||
{
|
||||
const auto& l = exp_modifiers.find(c->CharacterID());
|
||||
@@ -3189,6 +3206,18 @@ float Zone::GetEXPModifier(Client* c)
|
||||
return v.exp_modifier;
|
||||
}
|
||||
|
||||
float Zone::GetEXPModifierByCharacterID(const uint32 character_id)
|
||||
{
|
||||
const auto& l = exp_modifiers.find(character_id);
|
||||
if (l == exp_modifiers.end()) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
const auto& v = l->second;
|
||||
|
||||
return v.exp_modifier;
|
||||
}
|
||||
|
||||
void Zone::SetAAEXPModifier(Client* c, float aa_modifier)
|
||||
{
|
||||
auto l = exp_modifiers.find(c->CharacterID());
|
||||
@@ -3209,6 +3238,26 @@ void Zone::SetAAEXPModifier(Client* c, float aa_modifier)
|
||||
);
|
||||
}
|
||||
|
||||
void Zone::SetAAEXPModifierByCharacterID(const uint32 character_id, float aa_modifier)
|
||||
{
|
||||
auto l = exp_modifiers.find(character_id);
|
||||
if (l == exp_modifiers.end()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto& m = l->second;
|
||||
|
||||
m.aa_modifier = aa_modifier;
|
||||
|
||||
CharacterExpModifiersRepository::SetEXPModifier(
|
||||
database,
|
||||
character_id,
|
||||
GetZoneID(),
|
||||
GetInstanceVersion(),
|
||||
m
|
||||
);
|
||||
}
|
||||
|
||||
void Zone::SetEXPModifier(Client* c, float exp_modifier)
|
||||
{
|
||||
auto l = exp_modifiers.find(c->CharacterID());
|
||||
@@ -3229,6 +3278,26 @@ void Zone::SetEXPModifier(Client* c, float exp_modifier)
|
||||
);
|
||||
}
|
||||
|
||||
void Zone::SetEXPModifierByCharacterID(const uint32 character_id, float exp_modifier)
|
||||
{
|
||||
auto l = exp_modifiers.find(character_id);
|
||||
if (l == exp_modifiers.end()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto& m = l->second;
|
||||
|
||||
m.exp_modifier = exp_modifier;
|
||||
|
||||
CharacterExpModifiersRepository::SetEXPModifier(
|
||||
database,
|
||||
character_id,
|
||||
GetZoneID(),
|
||||
GetInstanceVersion(),
|
||||
m
|
||||
);
|
||||
}
|
||||
|
||||
bool Zone::IsIdleWhenEmpty() const
|
||||
{
|
||||
return m_idle_when_empty;
|
||||
|
||||
Reference in New Issue
Block a user