Fixes ItemLibrary compilation error in GCC.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-12-12 14:46:27 +01:00
parent 53bd6e7a94
commit ecf8582c59
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 3 additions and 1 deletions

View File

@ -8,7 +8,9 @@ namespace PkmnLib::Library {
public:
inline std::optional<ArbUt::BorrowedPtr<const Item>> TryGet(const ArbUt::BasicStringView& name) const {
auto res = CreatureLib::Library::ItemLibrary::TryGet(name.GetHash());
return reinterpret_cast<const std::optional<ArbUt::BorrowedPtr<const Item>>&>(res);
if (!res.has_value())
return {};
return res.value().ForceAs<const Item>();
}
inline ArbUt::BorrowedPtr<const Item> Get(const ArbUt::BasicStringView& name) const {