Add ConstString to several other places where context isn't changed much during runtime.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -25,7 +25,7 @@ void Battling::Creature::ChangeLevel(int8_t amount) {
|
||||
RecalculateFlatStats();
|
||||
}
|
||||
|
||||
const std::string& Battling::Creature::GetActiveTalent() const {
|
||||
const ConstString& Battling::Creature::GetActiveTalent() const {
|
||||
if (_hasOverridenTalent) {
|
||||
return _overridenTalentName;
|
||||
}
|
||||
@@ -124,7 +124,7 @@ void Battling::Creature::Heal(uint32_t amount) {
|
||||
_currentHealth = newHealth;
|
||||
}
|
||||
|
||||
void Battling::Creature::OverrideActiveTalent(const std::string& talent) {
|
||||
void Battling::Creature::OverrideActiveTalent(const ConstString& talent) {
|
||||
_hasOverridenTalent = true;
|
||||
_activeTalent->OnRemove();
|
||||
delete _activeTalent;
|
||||
@@ -183,7 +183,7 @@ void Battling::Creature::SetHeldItem(const Arbutils::CaseInsensitiveConstString&
|
||||
}
|
||||
_heldItem = item;
|
||||
}
|
||||
void Battling::Creature::AddVolatileScript(const std::string& name) {
|
||||
void Battling::Creature::AddVolatileScript(const ConstString& name) {
|
||||
auto script = _volatile.Get(name);
|
||||
if (script != nullptr) {
|
||||
script->Stack();
|
||||
@@ -194,6 +194,6 @@ void Battling::Creature::AddVolatileScript(const std::string& name) {
|
||||
}
|
||||
|
||||
void Battling::Creature::AddVolatileScript(Script* script) { _volatile.Add(script); }
|
||||
void Battling::Creature::RemoveVolatileScript(const std::string& name) { _volatile.Remove(name); }
|
||||
void Battling::Creature::RemoveVolatileScript(const ConstString& name) { _volatile.Remove(name); }
|
||||
void Battling::Creature::RemoveVolatileScript(Battling::Script* script) { _volatile.Remove(script->GetName()); }
|
||||
void Battling::Creature::HasVolatileScript(const std::string& name) const { _volatile.Has(name); }
|
||||
void Battling::Creature::HasVolatileScript(const ConstString& name) const { _volatile.Has(name); }
|
||||
|
||||
Reference in New Issue
Block a user