From e75ea30ece42244ee8e8101b03266a5505b48105 Mon Sep 17 00:00:00 2001 From: qndel Date: Sun, 22 Aug 2021 09:54:05 +0200 Subject: [PATCH] fix hellfire/cows crash --- Source/towners.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/towners.cpp b/Source/towners.cpp index b89f8889e..de85dc8d4 100644 --- a/Source/towners.cpp +++ b/Source/towners.cpp @@ -902,6 +902,12 @@ bool DebugTalkToTowner(std::string targetName) std::transform(targetName.begin(), targetName.end(), targetName.begin(), [](unsigned char c) { return std::tolower(c); }); auto &myPlayer = Players[MyPlayerId]; for (auto &towner : TownerInitList) { + // prevent going into hellfire territory without hellfire + if (towner.type == TOWN_COWFARM && !gbIsHellfire) + return false; + // cows have an init function that differs from the rest and isn't compatible with this code, skip them :( + if (towner.type == TOWN_COW) + continue; TownerStruct fakeTowner; towner.init(fakeTowner, towner); fakeTowner.position = myPlayer.position.tile;