Round origin coordinates to 1dp when converting from PC

Fixes incorrect loading of waypoints converted to PSP
This commit is contained in:
BCDeshiG 2022-11-10 22:09:01 +00:00
parent e5250b209f
commit 7ee994a55c

View file

@ -131,6 +131,10 @@ def parsePC(oldWayFile):
# Replace links to waypoint 0
"targets": ["255" if value == "0" else value for value in tempArray[7:-2]]
}
# Round origin coords to 1 decimal place
originCoords = waydict["origin"].strip("'").split()
originCoords = [round(float(coord), 1) for coord in originCoords]
waydict["origin"] = str(originCoords[0]) + " " + str(originCoords[1]) + " " + str(originCoords[2])
# Replace id 0
if waydict["id"] == "0":
waydict["id"] = "255" # I sure do hope nobody has this many waypoints