From 8f8478e7a5501acbc2307521ceb1afecf17aaceb Mon Sep 17 00:00:00 2001 From: "theastropath@gmail.com" Date: Wed, 24 May 2023 14:52:49 -0400 Subject: [PATCH] Swap InventorySpots of randomized items so that pathing works right with bots --- Classes/Randomizer.uc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Classes/Randomizer.uc b/Classes/Randomizer.uc index 993973c..8e67129 100644 --- a/Classes/Randomizer.uc +++ b/Classes/Randomizer.uc @@ -35,6 +35,8 @@ static function SwapActors(Actor a, Actor b) { local vector locA; local Rotator rotA; + local InventorySpot invSpot; + local Inventory invA, invB; locA = a.Location; rotA = a.Rotation; @@ -42,6 +44,19 @@ static function SwapActors(Actor a, Actor b) a.SetRotation(b.Rotation); b.SetLocation(locA); b.SetRotation(rotA); + + //At the moment, these should both be Inventory items, but... + if (Inventory(a)!=None && Inventory(b)!=None) { + invA = Inventory(a); + invB = Inventory(b); + + invSpot = invA.MyMarker; + invA.MyMarker = invB.MyMarker; + invB.MyMarker = invSpot; + + invA.MyMarker.markedItem = invA; + invB.MyMarker.markedItem = invB; + } } simulated function PreBeginPlay()