Skip to content

Commit

Permalink
Swap InventorySpots of randomized items so that pathing works right with
Browse files Browse the repository at this point in the history
bots
  • Loading branch information
theastropath committed May 24, 2023
1 parent 6640c66 commit 8f8478e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Classes/Randomizer.uc
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,28 @@ 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;
a.SetLocation(b.Location);
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()
Expand Down

0 comments on commit 8f8478e

Please sign in to comment.