Fixes for ScriptSet throwing when adding a not yet found volatile script.
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2021-03-27 20:20:49 +01:00
parent bfe83ef271
commit 1ddbfd2357
5 changed files with 17 additions and 17 deletions

View File

@@ -28,14 +28,14 @@ namespace CreatureLib::Battling {
return script;
}
std::optional<ArbUt::BorrowedPtr<BattleScript>> Get(const ArbUt::BasicStringView& key) const {
ArbUt::OptionalBorrowedPtr<BattleScript> Get(const ArbUt::BasicStringView& key) const {
return Get(key.GetHash());
}
std::optional<ArbUt::BorrowedPtr<BattleScript>> Get(uint32_t keyHash) const noexcept {
ArbUt::OptionalBorrowedPtr<BattleScript> Get(uint32_t keyHash) const noexcept {
auto v = _lookup.TryGet(keyHash);
if (v.has_value()) {
return _scripts[v.value()];
return _scripts[v.value()].GetRaw();
}
return {};
}