瀏覽代碼

Try to localize crash on missing combat animation

Ivan Savenko 1 年之前
父節點
當前提交
4f64b1f7e6
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      client/widgets/MiscWidgets.cpp

+ 3 - 0
client/widgets/MiscWidgets.cpp

@@ -637,6 +637,9 @@ CCreaturePic::CCreaturePic(int x, int y, const CCreature * cre, bool Big, bool A
 
 	assert(CGI->townh->size() > faction);
 
+	if (cre->animDefName.empty())
+		throw std::runtime_error("Creature " + cre->getJsonKey() + " has no valid combat animation!");
+
 	if(Big)
 		bg = std::make_shared<CPicture>((*CGI->townh)[faction]->creatureBg130);
 	else