mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
fix crash with custom campaign preview
This commit is contained in:
parent
3f3c079c0e
commit
abab917ef9
@ -149,7 +149,7 @@ CMapOverviewWidget::CMapOverviewWidget(CMapOverview& parent):
|
||||
|
||||
const JsonNode config(JsonPath::builtin("config/widgets/mapOverview.json"));
|
||||
|
||||
if(settings["lobby"]["mapPreview"].Bool())
|
||||
if(settings["lobby"]["mapPreview"].Bool() && p.tabType != ESelectionScreen::campaignList)
|
||||
{
|
||||
ResourcePath res = ResourcePath(p.resource.getName(), EResType::MAP);
|
||||
std::unique_ptr<CMap> campaignMap = nullptr;
|
||||
@ -192,7 +192,7 @@ CMapOverviewWidget::CMapOverviewWidget(CMapOverview& parent):
|
||||
{
|
||||
if(p.date.empty())
|
||||
{
|
||||
std::time_t time = boost::filesystem::last_write_time(*CResourceHandler::get()->getResourceName(ResourcePath(p.resource.getName(), EResType::MAP)));
|
||||
std::time_t time = boost::filesystem::last_write_time(*CResourceHandler::get()->getResourceName(ResourcePath(p.resource.getName(), p.tabType == ESelectionScreen::campaignList ? EResType::CAMPAIGN : EResType::MAP)));
|
||||
w->setText(vstd::getFormattedDateTime(time));
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user