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

This commit is contained in:
Deukhoofd committed 2020-12-12 14:46:27 +01:00
1 parent 53bd6e7a94
commit ecf8582c59
1 file changed
+3 -1
+3 -1
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 {