From c6b15b1ccb77e3e821aa31c0577d7a462d9cada6 Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Tue, 22 Nov 2022 11:03:28 -0800 Subject: [PATCH] Implements plugin: channel-safely v1.2a --- plugins/channel-safely/channel-safely-plugin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/channel-safely/channel-safely-plugin.cpp b/plugins/channel-safely/channel-safely-plugin.cpp index e5c9e2760..d291c0efc 100644 --- a/plugins/channel-safely/channel-safely-plugin.cpp +++ b/plugins/channel-safely/channel-safely-plugin.cpp @@ -128,8 +128,9 @@ df::coord simulate_area_fall(const df::coord &pos) { get_neighbours(pos, neighbours); df::coord lowest = simulate_fall(pos); for (auto p : neighbours) { - if (p.z < lowest.z) { - lowest = p; + auto nlow = simulate_fall(p); + if (nlow.z < lowest.z) { + lowest = nlow; } } return lowest; @@ -225,6 +226,7 @@ namespace CSP { } void UnpauseEvent(){ + CoreSuspender suspend; // we need exclusive access to df memory and this call stack doesn't already have a lock INFO(monitor).print("UnpauseEvent()\n"); ChannelManager::Get().build_groups(); ChannelManager::Get().manage_groups();