diff engine/core/view/camera.cpp @ 408:219b8036708c

Fixed a small bug where the facing_angle wasn't being initialized.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Sat, 30 Jan 2010 16:11:38 +0000
parents f27880d4c08c
children 9d94f4676d17
line wrap: on
line diff
--- a/engine/core/view/camera.cpp	Fri Jan 29 21:03:51 2010 +0000
+++ b/engine/core/view/camera.cpp	Sat Jan 30 16:11:38 2010 +0000
@@ -536,10 +536,11 @@
 					FL_DBG(_log, "Instance has action");
 					int animation_id = action->getVisual<ActionVisual>()->getAnimationIndexByAngle(vc.facing_angle + m_rotation);
 
-					int facing_angle;
-					if (vc.facing_angle < 0){
-						facing_angle = 360+vc.facing_angle; //make it a positive angle
+					int facing_angle = vc.facing_angle;
+					if (facing_angle < 0){
+						facing_angle = 360+facing_angle; //make it a positive angle
 					}
+					facing_angle %= 360;
 					instance->setRotation(facing_angle);  //update so the animation has correct rotation
 
 					Animation& animation = m_apool->getAnimation(animation_id);