Fix duplicate stacked IFF locks breaking dropship center CC doors

This commit is contained in:
Mazo 2021-04-12 22:55:48 +01:00 committed by Jakob Gillich
parent ba490051cd
commit 0143f3b072

View file

@ -371,12 +371,15 @@ object Zones {
// Since tech plant garage locks are the only type where the lock does not face the same direction as the door we need to apply an offset for those, otherwise the door won't operate properly when checking inside/outside angles. // Since tech plant garage locks are the only type where the lock does not face the same direction as the door we need to apply an offset for those, otherwise the door won't operate properly when checking inside/outside angles.
val yawOffset = if (obj.objectType == "lock_garage") 90 else 0 val yawOffset = if (obj.objectType == "lock_garage") 90 else 0
zoneMap.addLocalObject( // Ignore duplicate lock objects, for example Sobek (and other Dropship Centers) CC door has 2 locks stacked on top of each other
obj.guid, if (!zoneMap.doorToLock.keys.iterator.contains(closestDoor.guid)) {
IFFLock.Constructor(obj.position, Vector3(0, 0, obj.yaw + yawOffset)), zoneMap.addLocalObject(
owningBuildingGuid = ownerGuid, obj.guid,
doorGuid = closestDoor.guid IFFLock.Constructor(obj.position, Vector3(0, 0, obj.yaw + yawOffset)),
) owningBuildingGuid = ownerGuid,
doorGuid = closestDoor.guid
)
}
case objectType if structure.isDefined && terminalTypes.contains(objectType) => case objectType if structure.isDefined && terminalTypes.contains(objectType) =>
// SoE in their infinite wisdom decided to remap vehicle_terminal to vehicle_terminal_combined in certain cases in the game_objects.adb file. // SoE in their infinite wisdom decided to remap vehicle_terminal to vehicle_terminal_combined in certain cases in the game_objects.adb file.