From 22b4795f8661a054446c4c416f365d38df5328a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zieli=C5=84ski?= Date: Fri, 9 Sep 2022 21:02:16 +0200 Subject: [PATCH] Well, we should have some sensible exception handling in VCMI --- lib/mapObjects/CGHeroInstance.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/mapObjects/CGHeroInstance.cpp b/lib/mapObjects/CGHeroInstance.cpp index ac97dd901..dbe4e77c7 100644 --- a/lib/mapObjects/CGHeroInstance.cpp +++ b/lib/mapObjects/CGHeroInstance.cpp @@ -1412,7 +1412,9 @@ void CGHeroInstance::setHeroTypeName(const std::string & identifier) if(rawId) subID = rawId.get(); else - subID = 0; //fallback to Orrin, throw error instead? + { + throw std::runtime_error("Couldn't resolve hero identifier " + identifier); + } } }