(797046bbf) Fixed deselecting an item with Esc/E causing the character to interact with whatever the cursor is focused on. TODO: Fix autointeracting causing entities to be selected in MP (e.g. picking up an ammunition box by interacting with the loader causes the loader to be selected)

This commit is contained in:
Joonas Rikkonen
2019-03-29 17:26:40 +02:00
parent d4d6a2ad30
commit 902e5e4493

View File

@@ -226,8 +226,15 @@ namespace Barotrauma
if (SelectedConstruction != null && SelectedConstruction.ActiveHUDs.Any(ic => ic.GuiFrame != null && HUD.CloseHUD(ic.GuiFrame.Rect)))
{
//emulate a Select input to get the character to deselect the item server-side
keys[(int)InputType.Select].Hit = true;
if (GameMain.Client != null)
{
//emulate a Select input to get the character to deselect the item server-side
keys[(int)InputType.Select].Hit = true;
}
//reset focus to prevent us from accidentally interacting with another entity
focusedItem = null;
focusedCharacter = null;
findFocusedTimer = 0.2f;
SelectedConstruction = null;
}