changeset 399:d98e398d3057

This change ensures that the instances rotation is always in sync with its facing location.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 28 Jan 2010 03:26:29 +0000
parents 7b1de5e31834
children ef0c7a0cacab
files engine/core/view/camera.cpp
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/engine/core/view/camera.cpp	Wed Jan 27 21:15:24 2010 +0000
+++ b/engine/core/view/camera.cpp	Thu Jan 28 03:26:29 2010 +0000
@@ -524,7 +524,14 @@
 					drawpt = toScreenCoordinates( instance->getLocationRef().getMapCoordinates() );
 					vc.facing_angle = angle = getAngleBetween(instance->getLocationRef(), instance->getFacingLocation());
 				}
-				angle += instance->getRotation();
+				
+				//This is to fix ticket #361.  I would rather not have to put this here.
+				//It should be handled in a more appropriate spot like within Instance::setFacingLocation().  
+				//It ensures the instances rotation is in sync with it's facing direction.
+				if (angle < 0) {
+					angle = 360+angle;
+				}
+				instance->setRotation(angle);
 
 				Image* image = NULL;
 				Action* action = instance->getCurrentAction();