From 5fa338ac5ce9c9a19371ceed1e635fdec6ad570f Mon Sep 17 00:00:00 2001 From: meikelm Date: Wed, 28 Aug 2024 11:29:23 -0700 Subject: [PATCH] fix WED-1520 crash upon revert --- src/WEDCore/README.WorldEditor | 4 ++++ src/WEDCore/WED_Archive.cpp | 5 ++++- src/WEDCore/WED_Version.h | 8 ++++---- src/WEDImportExport/WED_DSFExport.cpp | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/WEDCore/README.WorldEditor b/src/WEDCore/README.WorldEditor index b9f603c08..2ff85d3f0 100644 --- a/src/WEDCore/README.WorldEditor +++ b/src/WEDCore/README.WorldEditor @@ -13,6 +13,10 @@ menu to view it online. CHANGE HISTORY +WED 2.6.0r2 + Bug fix: + - fix crash when reverting to existing scenery + WED 2.6.0r1 8/16/24 Bug fix: - improve GW upgrade heuristics to change less JW lengths diff --git a/src/WEDCore/WED_Archive.cpp b/src/WEDCore/WED_Archive.cpp index 203107d91..2632d22b9 100644 --- a/src/WEDCore/WED_Archive.cpp +++ b/src/WEDCore/WED_Archive.cpp @@ -97,7 +97,10 @@ void WED_Archive::RemoveObject(WED_Persistent * inObject) { if (mDying) return; ++mCacheKey; - mObjects.erase(inObject->GetID()); + auto iter = mObjects.find(inObject->GetID()); + Assert(iter != mObjects.end()); + iter->second = NULL; + #if WITHNWLINK if (mNWAdapter) mNWAdapter->ObjectDestroyed(inObject); #endif diff --git a/src/WEDCore/WED_Version.h b/src/WEDCore/WED_Version.h index d6ed14b00..86912ec7b 100644 --- a/src/WEDCore/WED_Version.h +++ b/src/WEDCore/WED_Version.h @@ -29,18 +29,18 @@ // These versions are used in about boxes, resources, info boxes, etc. -#define WED_VERSION 2.6.0r1 -#define WED_VERSION_STRING "2.6.0r1" +#define WED_VERSION 2.6.0r2 +#define WED_VERSION_STRING "2.6.0r2" #define WED_VERSION_STRING_SHORT "2.6" // omit beta/release number and trailing zero's #define WED_COPYRIGHT_STRING "(C) Copyright 2007-2024, Laminar Research." #define WED_VERSION_RES WED_VERSION_STRING -#define WED_VERSION_BIN 2,6,0,1 +#define WED_VERSION_BIN 2,6,0,2 // This numeric is used by the gateway to understand if our WED is up-to-date. // Format 1 digit major + 2 digit middle + 1 digit minor version + last digit // last digit is 0 for all beta versions or matches release version -#define WED_VERSION_NUMERIC 20601 +#define WED_VERSION_NUMERIC 20602 #endif /* WED_Version_H */ diff --git a/src/WEDImportExport/WED_DSFExport.cpp b/src/WEDImportExport/WED_DSFExport.cpp index 566e0658c..9b6c16a16 100644 --- a/src/WEDImportExport/WED_DSFExport.cpp +++ b/src/WEDImportExport/WED_DSFExport.cpp @@ -1701,7 +1701,7 @@ static int DSF_ExportTileRecursive( { c[0] = p.x(); c[1] = p.y(); - c[2] = 0.6 * fst_info->max_height; // random (min_height, max_height); + c[2] = 0.8 * fst_info->max_height; // random (min_height, max_height); c[3] = dem_info->xy_nearest(p.x(), p.y()); cbs->AddPolygonPoint_f(c, writer);