瀏覽代碼

Update client/windows/GUIClasses.cpp

Co-authored-by: Nordsoft91 <[email protected]>
Laserlicht 2 年之前
父節點
當前提交
5a84e7cd7f
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      client/windows/GUIClasses.cpp

+ 2 - 2
client/windows/GUIClasses.cpp

@@ -501,8 +501,8 @@ CTavernWindow::CTavernWindow(const CGObjectInstance * TavernObj, const std::func
 	}
 	}
 	if(LOCPLINT->castleInt)
 	if(LOCPLINT->castleInt)
 		CCS->videoh->open(LOCPLINT->castleInt->town->town->clientInfo.tavernVideo);
 		CCS->videoh->open(LOCPLINT->castleInt->town->town->clientInfo.tavernVideo);
-	else if(dynamic_cast<const CGTownInstance *>(TavernObj))
-		CCS->videoh->open(dynamic_cast<const CGTownInstance *>(TavernObj)->town->clientInfo.tavernVideo);
+	else if(const auto * townObj = dynamic_cast<const CGTownInstance *>(TavernObj))
+		CCS->videoh->open(townObj->town->clientInfo.tavernVideo);
 	else
 	else
 		CCS->videoh->open(VideoPath::builtin("TAVERN.BIK"));
 		CCS->videoh->open(VideoPath::builtin("TAVERN.BIK"));
 }
 }