In previous versions all works. Now in 1.16 appear problem that when player linked to local space of another entity (vehicle in my case) they cannot put item to hands. Also hotbar stopped working. This bug makes Linktolocalspace useless. Please fix that. Thanks.
Description
Details
- Severity
- None
- Resolution
- Open
- Reproducibility
- N/A
- Operating System
- Windows 7
- Category
- General
- use Linktolocalspace
- try take item to hands
It worked many months and now is broken
Event Timeline
I have tested this with my mod both in singleplayer and multiplayer and it seemed to work fine. Not really sure if it is broken. Can you double-check by making a minimal setup that does nothing but attaches you to some entity (preferably not modded) and see how that goes?
I will try make minimum setup and let you know. But its very strange that it worked for months and now stopped working. Something with inventory was touched by devs probably. I saw also some 1.16 inventory fix mod from Spurgle in workshop.
Looks like you found it. Problem not occur when player linked to localspace for example house, but only when linked to vehicle.
In attached video you can see that attaching to vehicle break hand inventory and attaching to train(housenodestruct) is fine
IsInVehicle() started checking for parent transport in 1.16.
bool IsInVehicle() { return m_MovementState.m_CommandTypeId == DayZPlayerConstants.COMMANDID_VEHICLE || (GetParent() != null && GetParent().IsInherited(Transport)); }
The actual problem is with TryHideItemInHands, it will turn hide = false into hide = true if parent is vehicle, which is unexpected. Workaround:
override void TryHideItemInHands(bool hide, bool force = false) { if (!hide && GetParent() && GetParent().IsInherited(Transport)) { super.TryHideItemInHands(false, true); return; } super.TryHideItemInHands(hide, force); }
Its needed mod PlayerBase.
variable RTLinked is my own which return true when is player linked to vehicle, its helper varible for situations when player is linked to vehicle but not sitting inside.
override bool IsInVehicle() { if (RTisLinked) { return false; } return super.IsInVehicle(); }
It not probably best way, but its at least quick workaround which returns needed functionality.