Make SpeciesVariants smart pointers.
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
This commit is contained in:
@@ -7,10 +7,11 @@
|
||||
using namespace CreatureLib;
|
||||
|
||||
Battling::Creature::Creature(const BattleLibrary* library, const borrowed_ptr<const Library::CreatureSpecies>& species,
|
||||
const Library::SpeciesVariant* variant, uint8_t level, uint32_t experience, uint32_t uid,
|
||||
Library::Gender gender, uint8_t coloring, const borrowed_ptr<const Library::Item> heldItem,
|
||||
std::string nickname, const Library::TalentIndex& talent,
|
||||
const List<LearnedAttack*>& attacks, bool allowedExperienceGain)
|
||||
const borrowed_ptr<const Library::SpeciesVariant>& variant, uint8_t level,
|
||||
uint32_t experience, uint32_t uid, Library::Gender gender, uint8_t coloring,
|
||||
const borrowed_ptr<const Library::Item> heldItem, std::string nickname,
|
||||
const Library::TalentIndex& talent, const List<LearnedAttack*>& attacks,
|
||||
bool allowedExperienceGain)
|
||||
: _library(library), _species(species), _variant(variant), _level(level), _experience(experience),
|
||||
_uniqueIdentifier(uid), _gender(gender), _coloring(coloring), _heldItem(heldItem), _nickname(std::move(nickname)),
|
||||
_talentIndex(talent), _hasOverridenTalent(false), _attacks(attacks),
|
||||
@@ -191,7 +192,7 @@ borrowed_ptr<const Library::CreatureSpecies> Battling::Creature::GetDisplaySpeci
|
||||
species = _species;
|
||||
return species;
|
||||
}
|
||||
const Library::SpeciesVariant* Battling::Creature::GetDisplayVariant() const noexcept {
|
||||
borrowed_ptr<const Library::SpeciesVariant> Battling::Creature::GetDisplayVariant() const noexcept {
|
||||
auto variant = _displayVariant;
|
||||
if (variant == nullptr)
|
||||
variant = _variant;
|
||||
|
||||
Reference in New Issue
Block a user