From 578800b3e368e70c67f4e0076bd7332defb68e1e Mon Sep 17 00:00:00 2001 From: godric3 Date: Sat, 11 May 2024 21:54:24 +0200 Subject: [PATCH] map editor: fix prison hero selection --- mapeditor/inspector/inspector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mapeditor/inspector/inspector.cpp b/mapeditor/inspector/inspector.cpp index 42dc8c2d6..b5de5ccf4 100644 --- a/mapeditor/inspector/inspector.cpp +++ b/mapeditor/inspector/inspector.cpp @@ -317,7 +317,7 @@ void Inspector::updateProperties(CGHeroInstance * o) addProperty("Skills", PropertyEditorPlaceholder(), delegate, false); addProperty("Spells", PropertyEditorPlaceholder(), new HeroSpellDelegate(*o), false); - if(o->type) + if(o->type || o->ID == Obj::PRISON) { //Hero type auto * delegate = new InspectorDelegate; for(int i = 0; i < VLC->heroh->objects.size(); ++i) @@ -330,7 +330,7 @@ void Inspector::updateProperties(CGHeroInstance * o) } } } - addProperty("Hero type", o->type->getNameTranslated(), delegate, false); + addProperty("Hero type", o->type ? o->type->getNameTranslated() : "", delegate, false); } }