Page MenuHomeFeedback Tracker

Cannot put item to hands while linked to local space of vehicle (transport)
New, UrgentPublic

Description

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.

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
General
Steps To Reproduce
  • use Linktolocalspace
  • try take item to hands
Additional Information

It worked many months and now is broken

Event Timeline

Hunterz created this task.Feb 18 2022, 9:04 AM

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

Hunterz renamed this task from Cannot put item to hands while linked to local space of another entity to Cannot put item to hands while linked to local space of vehicle (transport).Feb 18 2022, 3:11 PM
lava76 added a subscriber: lava76.Feb 20 2022, 12:51 AM
lava76 added a comment.EditedMar 11 2022, 1:06 PM

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);
	}

unfortunately not helps :/

Lugge2 added a subscriber: Lugge2.Mar 17 2022, 6:35 PM

I have the same error with my raft.

I already found howto fix. Can be closed.

@Hunterz it might help others if you could tell them how you fixed it :)

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.