Force insertion when setting species variant, as to prevent memory leaks.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
3303dfd82d
commit
f973259bef
|
@ -40,7 +40,7 @@ namespace CreatureLib::Library {
|
||||||
[[nodiscard]] Gender GetRandomGender(Core::Random& rand) const;
|
[[nodiscard]] Gender GetRandomGender(Core::Random& rand) const;
|
||||||
[[nodiscard]] const std::string& GetName() const;
|
[[nodiscard]] const std::string& GetName() const;
|
||||||
|
|
||||||
void SetVariant(const std::string& name, const SpeciesVariant* variant) { _variants[name] = variant; }
|
void SetVariant(const std::string& name, const SpeciesVariant* variant) { _variants.insert({name, variant}); }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue