From a516811bb1e6e7efe88ecd06b567df89162cfa0f Mon Sep 17 00:00:00 2001 From: lethosor Date: Tue, 13 May 2014 16:41:55 -0400 Subject: [PATCH] Only allow 3dveins to be run in fortress mode Prevents crash from running in arena mode --- plugins/3dveins.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/3dveins.cpp b/plugins/3dveins.cpp index 432d93cf6..c9e15aae5 100644 --- a/plugins/3dveins.cpp +++ b/plugins/3dveins.cpp @@ -42,6 +42,7 @@ using namespace MapExtras; using namespace DFHack::Random; using df::global::world; +using df::global::gametype; command_result cmd_3dveins(color_ostream &out, std::vector & parameters); @@ -1573,6 +1574,12 @@ command_result cmd_3dveins(color_ostream &con, std::vector & parame return CR_FAILURE; } + if (*gametype != game_type::DWARF_MAIN && *gametype != game_type::DWARF_RECLAIM) + { + con.printerr("Must be used in fortress mode!\n"); + return CR_FAILURE; + } + VeinGenerator generator(con); con.print("Collecting statistics...\n");