From d81c611ad76792940a41dd4ebc134df28bde48e2 Mon Sep 17 00:00:00 2001 From: AlexVinS Date: Fri, 25 Nov 2016 21:32:54 +0300 Subject: [PATCH] Fixed CID 1197423, CID 1197567 --- lib/CObstacleInstance.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/CObstacleInstance.cpp b/lib/CObstacleInstance.cpp index 0c9d27208..5443f3d09 100644 --- a/lib/CObstacleInstance.cpp +++ b/lib/CObstacleInstance.cpp @@ -18,6 +18,8 @@ CObstacleInstance::CObstacleInstance() { obstacleType = USUAL; + uniqueID = -1; + ID = -1; } CObstacleInstance::~CObstacleInstance() @@ -33,12 +35,9 @@ const CObstacleInfo & CObstacleInstance::getInfo() const return VLC->heroh->absoluteObstacles[ID]; case USUAL: return VLC->heroh->obstacles[ID]; - case MOAT: - assert(0); default: - assert(0); + throw std::runtime_error("Unknown obstacle type in CObstacleInstance::getInfo()"); } - throw std::runtime_error("Unknown obstacle type in CObstacleInstance::getInfo()"); } std::vector CObstacleInstance::getBlockedTiles() const