Browse Source

fix hellfire/cows crash

pull/2682/head
qndel 5 years ago
parent
commit
e75ea30ece
  1. 6
      Source/towners.cpp

6
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;

Loading…
Cancel
Save