From 52a24f36e190ee1e2a8c629d3af9d29145135bd9 Mon Sep 17 00:00:00 2001 From: Johannes Brust Date: Mon, 25 Mar 2024 09:34:07 +0100 Subject: [PATCH 1/2] Fix triggered actions not being recreated --- src/Griddly/Core/TurnBasedGameProcess.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Griddly/Core/TurnBasedGameProcess.cpp b/src/Griddly/Core/TurnBasedGameProcess.cpp index 8d4e304c..8e045567 100644 --- a/src/Griddly/Core/TurnBasedGameProcess.cpp +++ b/src/Griddly/Core/TurnBasedGameProcess.cpp @@ -124,6 +124,10 @@ std::shared_ptr TurnBasedGameProcess::fromGameState(GameSt std::unordered_map> loadedObjectMapping; + for (auto& actionTriggerDefinitionIt : objectGenerator->getActionTriggerDefinitions()) { + loadedGrid->addActionTrigger(actionTriggerDefinitionIt.first, actionTriggerDefinitionIt.second); + } + // Behaviour probabilities loadedGrid->setBehaviourProbabilities(objectGenerator->getBehaviourProbabilities()); From 64d7f5e76dfd593dbd0fb7c256fe3eb66ad8f652 Mon Sep 17 00:00:00 2001 From: Johannes Brust Date: Tue, 9 Apr 2024 11:28:58 +0200 Subject: [PATCH 2/2] Fix inverted left and right directions from string --- src/Griddly/Core/GDY/Actions/Direction.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Griddly/Core/GDY/Actions/Direction.hpp b/src/Griddly/Core/GDY/Actions/Direction.hpp index edc927f2..91e68d69 100644 --- a/src/Griddly/Core/GDY/Actions/Direction.hpp +++ b/src/Griddly/Core/GDY/Actions/Direction.hpp @@ -149,9 +149,9 @@ class DiscreteOrientation { const std::unordered_map stringMapping = { {"NONE", {0, 0}}, {"UP", {0, -1}}, - {"RIGHT", {-1, 0}}, + {"RIGHT", {1, 0}}, {"DOWN", {0, 1}}, - {"LEFT", {1, 0}}, + {"LEFT", {-1, 0}}, }; const auto& vector = stringMapping.find(string); if (vector != stringMapping.end()) {