Skip to content

Commit

Permalink
ClearInHand function to fix deleting items traveling from NG+ and new…
Browse files Browse the repository at this point in the history
… game menu
  • Loading branch information
Die4Ever committed Sep 10, 2023
1 parent 6ceed86 commit 112c0ae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
17 changes: 12 additions & 5 deletions DXRModules/DeusEx/Classes/DXRFlagsNGPMaxRando.uc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
class DXRFlagsNGPMaxRando extends DXRFlagsBase transient;


simulated function ExecMaxRando()
{
// set local seed
Expand Down Expand Up @@ -223,9 +222,6 @@ function NewGamePlus()
p.DeleteAllNotes();
p.DeleteAllGoals();
p.ResetConversationHistory();
p.SetInHandPending(None);
p.SetInHand(None);
p.bInHandTransition = False;
p.RestoreAllHealth();
ClearDataVaultImages();
Expand All @@ -242,7 +238,7 @@ function NewGamePlus()
if( augs != None )
augs.RemoveRandomAug(p);
// TODO: do this in the intro instead of in the credits?
ClearInHand(p);
RemoveRandomWeapon(p);
//Should you actually get fresh augs and credits on a NG+ non-vanilla start map?
Expand All @@ -261,6 +257,17 @@ function NewGamePlus()
Level.Game.SendPlayer(p, "00_intro");
}
simulated function ClearInHand(#var(PlayerPawn) p)
{
p.SetInHand(None);
p.SetInHandPending(None);
p.bInHandTransition = False;
p.LastinHand = None;
p.ClientinHandPending = None;
p.inHandPending = None;
p.inHand = None;
}
simulated function RemoveRandomWeapon(#var(PlayerPawn) p)
{
local Inventory i, next;
Expand Down
3 changes: 2 additions & 1 deletion GUI/DeusEx/Classes/DXRMenuScreenNewGame.uc
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ function SaveSettings()
i.Destroy();
}
player.Inventory = None;
dxr.flags.ClearInHand(#var(PlayerPawn)(player));
player.RestoreAllHealth();
if (DeusExRootWindow(player.rootWindow) != None)
DeusExRootWindow(player.rootWindow).ResetFlags();
Expand Down Expand Up @@ -235,7 +236,7 @@ function ProcessAction(String actionKey)
else
{
SaveSettings();
AddTimer(0.1, false, 0, 'Timer');// timer to wait for items to be destroyed (issue #426)
AddTimer(0.11, false, 0, 'Timer');// timer to wait for items to be destroyed (issue #426), deletes happen every 100ms? probably don't need this anymore with our new ClearInHand() function
}
}
else
Expand Down

0 comments on commit 112c0ae

Please sign in to comment.