Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed fife rotation bullshit (hopefully)

  • Loading branch information...
commit b6a6c621923fc496746b141b973416a55fc9bfab 1 parent 9ce07bb
@karottenreibe karottenreibe authored
View
BIN  content/maps/quattro.sqlite
Binary file not shown
View
19 editor/plugins/UHMapSaver.py
@@ -42,9 +42,26 @@ def __init__(self, filepath, engine, map, importList):
self._map = map
self._mapDatabase = None
+ def _fixRotation(self, rotation):
+ """
+ Fixes FIFEs botched handling of rotations.
+ Rotations are a) 0, 90, 180 or 270 and b) sometimes
+ off by one.
+ """
+ rotation = rotation % 360
+ if (0 <= rotation and rotation < 45) or (315 <= rotation and rotation < 360):
+ rotation = 45
+ elif 45 <= rotation and rotation < 135:
+ rotation = 135
+ elif 135 <= rotation and rotation < 225:
+ rotation = 225
+ elif 225 <= rotation and rotation < 315:
+ rotation = 315
+ return rotation
+
def _extractPositionRotationFromInstance(self, instance):
"""Extracts the position and the rotation from an instance and returns it as a tuple"""
- rotation = instance.getRotation()
+ rotation = self._fixRotation(instance.getRotation())
position = instance.getLocationRef().getExactLayerCoordinates()
print "get", rotation
return (position, rotation)
Please sign in to comment.
Something went wrong with that request. Please try again.