From f073031689fd2dd6f4d89d1f1fbf92c6a6fe2861 Mon Sep 17 00:00:00 2001 From: AlexVinS Date: Mon, 29 May 2017 12:39:08 +0300 Subject: [PATCH] Fixed https://bugs.vcmi.eu/view.php?id=2686 --- lib/CTownHandler.cpp | 1 - lib/mapping/MapFormatH3M.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/CTownHandler.cpp b/lib/CTownHandler.cpp index 5f75b59bf..4315eb9b7 100644 --- a/lib/CTownHandler.cpp +++ b/lib/CTownHandler.cpp @@ -82,7 +82,6 @@ CFaction::~CFaction() CTown::CTown() : faction(nullptr), mageLevel(0), primaryRes(0), moatDamage(0), defaultTavernChance(0) { - faction = nullptr; } CTown::~CTown() diff --git a/lib/mapping/MapFormatH3M.cpp b/lib/mapping/MapFormatH3M.cpp index 73cedfaf8..d9dd05d24 100644 --- a/lib/mapping/MapFormatH3M.cpp +++ b/lib/mapping/MapFormatH3M.cpp @@ -2231,7 +2231,7 @@ void CMapLoaderH3M::afterRead() for(auto obj : t.visitableObjects) { - if(obj->ID = Obj::TOWN) + if(obj->ID == Obj::TOWN || obj->ID == Obj::RANDOM_TOWN) { mainTown = obj; break;