# HG changeset patch # User prock@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1264649189 0 # Node ID d98e398d3057f207dba61ade5195dba90e4cdaf0 # Parent 7b1de5e31834b8eda2f7957990c0b6feacda6642 This change ensures that the instances rotation is always in sync with its facing location. diff -r 7b1de5e31834 -r d98e398d3057 engine/core/view/camera.cpp --- 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();