From 0911d35696e0255533d5e1ff7183493d7c8a6619 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 30 Apr 2025 13:34:15 -0500 Subject: [PATCH] Fix preview town/outdoor dialog crash --- src/scenedit/scen.keydlgs.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/scenedit/scen.keydlgs.cpp b/src/scenedit/scen.keydlgs.cpp index 52e4be9c..e359360d 100644 --- a/src/scenedit/scen.keydlgs.cpp +++ b/src/scenedit/scen.keydlgs.cpp @@ -30,6 +30,8 @@ extern short cen_x, cen_y; extern bool mouse_button_held; extern short cur_viewing_mode; +extern short cur_town; +extern location cur_out; extern cTown* town; extern short mode_count,to_create; extern ter_num_t template_terrain[64][64]; @@ -39,8 +41,13 @@ extern cCustomGraphics spec_scen_g; static bool preview_spec_enc_dlog(cDialog& me, std::string item_hit, cSpecial& special, short mode) { eSpecCtxType cur_type = static_cast(mode); + + // Not pretty, but works: cUniverse univ; univ.scenario = scenario; + univ.party.town_num = cur_town; + univ.party.outdoor_corner = cur_out; + univ.party.i_w_c = {0, 0}; switch(special.type){ case eSpecType::ONCE_DIALOG: