Skip to content

Commit

Permalink
fixed index issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanis002 committed Jan 9, 2024
1 parent 2c03117 commit 93849c1
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions fast64_internal/oot/oot_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,16 @@ def upgradeActors(actorObj: Object):
transActorProp.isRoomTransition = actorObj["ootTransitionActorProperty"]["dontTransition"] == False
del actorObj["ootTransitionActorProperty"]["dontTransition"]

if "roomIndex" in transActorProp:
for obj in bpy.data.objects:
if obj.type == "EMPTY":
if obj.ootEmptyType == "Room":
if actorObj in obj.children_recursive:
transActorProp.fromRoom = obj

if "roomIndex" in transActorProp and transActorProp.fromRoom is not None:
for obj in bpy.data.objects:
if obj.type == "EMPTY":
if obj.ootEmptyType == "Room":
if actorObj in obj.children_recursive:
transActorProp.fromRoom = obj

if obj.ootRoomHeader.roomIndex == actorObj["ootTransitionActorProperty"]["roomIndex"]:
transActorProp.toRoom = obj
del actorObj["ootTransitionActorProperty"]["roomIndex"]
if obj.name != transActorProp.fromRoom.name and obj.type == "EMPTY" and obj.ootEmptyType == "Room":
if obj.ootRoomHeader.roomIndex == actorObj["ootTransitionActorProperty"]["roomIndex"]:
transActorProp.toRoom = obj
del actorObj["ootTransitionActorProperty"]["roomIndex"]
break

0 comments on commit 93849c1

Please sign in to comment.