From f4cb6569211316d496e6896d595e5f66da1f15e1 Mon Sep 17 00:00:00 2001 From: ln-zookeeper Date: Sat, 27 Feb 2016 21:20:58 +0200 Subject: [PATCH] Fixed the unit_creator crash part of bug #24439 --- src/actions/unit_creator.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/actions/unit_creator.cpp b/src/actions/unit_creator.cpp index 6e545014e2b8..360bb186da79 100644 --- a/src/actions/unit_creator.cpp +++ b/src/actions/unit_creator.cpp @@ -217,7 +217,10 @@ void unit_creator::post_create(const map_location &loc, const unit &new_unit, bo } } - resources::game_events->pump().fire("unit placed", loc); + // Only fire the events if it's safe; it's not if we're in the middle of play_controller::reset_gamestate() + if (resources::lua_kernel != NULL) { + resources::game_events->pump().fire("unit placed", loc); + } if (resources::screen!=NULL) {