[colobot] 39/74: Normalize dir parameter when copying to clipboard

Didier Raboud odyx at moszumanska.debian.org
Mon Nov 7 07:50:03 UTC 2016


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch debian/master
in repository colobot.

commit 514829de60e8d1de232c2995451c53c5ac7785a9
Author: MrSimbax <mateuszprzybyl at simbax.info>
Date:   Sat Aug 20 13:22:53 2016 +0200

    Normalize dir parameter when copying to clipboard
---
 src/level/robotmain.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/level/robotmain.cpp b/src/level/robotmain.cpp
index 7ed6ef2..23c9c9d 100644
--- a/src/level/robotmain.cpp
+++ b/src/level/robotmain.cpp
@@ -981,10 +981,13 @@ bool CRobotMain::ProcessEvent(Event &event)
                     {
                         CLevelParserLine line("CreateObject");
                         line.AddParam("type", MakeUnique<CLevelParserParam>(obj->GetType()));
+
                         Math::Vector pos = obj->GetPosition()/g_unit;
                         pos.y = 0.0f;
                         line.AddParam("pos", MakeUnique<CLevelParserParam>(pos));
-                        line.AddParam("dir", MakeUnique<CLevelParserParam>(obj->GetRotationY()));
+
+                        float dir = Math::NormAngle(obj->GetRotationY()) / Math::PI;
+                        line.AddParam("dir", MakeUnique<CLevelParserParam>(dir));
 
                         std::stringstream ss;
                         ss << line;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git



More information about the Pkg-games-commits mailing list