From c64e9b38148542ae34c5f03206c52f48da4fd514 Mon Sep 17 00:00:00 2001 From: Maikel de Vries Date: Sun, 26 Mar 2017 21:15:05 +0200 Subject: [PATCH] scenario saving: fix position after movement by setting con and rotating --- planet/System.ocg/SaveScenario.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/planet/System.ocg/SaveScenario.c b/planet/System.ocg/SaveScenario.c index f1058f67a..a3ac564ee 100644 --- a/planet/System.ocg/SaveScenario.c +++ b/planet/System.ocg/SaveScenario.c @@ -470,6 +470,9 @@ global func SaveScenarioObject(props) } } } + // A con of != 100 and a non-zero rotation may have moved the object, if so re-center it after setting the con and rotation. + if (is_centered_creation && (GetCon != 100 || (GetR() && !Contained()))) + props->AddCall("SetPosition", this, "SetPosition", GetX(), GetY()); // Automatic unsticking for items lying on the ground and for animals / clonks // Do this after Con/Rotation and other calls that may affect the shape // (Note: If someone loads a game in paused mode and immediately saves without unpausing, most unstick calls for items will be lost)