From ecf8582c59c854b7e2986f3f08b3e09b2801ed55 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 12 Dec 2020 14:46:27 +0100 Subject: [PATCH] Fixes ItemLibrary compilation error in GCC. --- src/Library/Items/ItemLibrary.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Library/Items/ItemLibrary.hpp b/src/Library/Items/ItemLibrary.hpp index 1f52738..5ad39cd 100644 --- a/src/Library/Items/ItemLibrary.hpp +++ b/src/Library/Items/ItemLibrary.hpp @@ -8,7 +8,9 @@ namespace PkmnLib::Library { public: inline std::optional> TryGet(const ArbUt::BasicStringView& name) const { auto res = CreatureLib::Library::ItemLibrary::TryGet(name.GetHash()); - return reinterpret_cast>&>(res); + if (!res.has_value()) + return {}; + return res.value().ForceAs(); } inline ArbUt::BorrowedPtr Get(const ArbUt::BasicStringView& name) const {