If player drop item while stay on car, item falls to the ground under the car or in to textures of car under player
Description
Description
Details
Details
- Severity
- None
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 7
- Category
- General
Steps To Reproduce
1.08 Experemental
Stay on car
Drop item from hands by press G or move from invenory
Item falls on any surface under car
Event Timeline
Comment Actions
Hello borizz.k and thank you for the report.
The items cannot be dropped on top of a vehicle due to a technical limitation and there is not an easy solution to this at the moment.
Regards,
Geez
Comment Actions
I fix it for 1.08 exp
resolve of this issue have two very easy ways
- In itemBase class (better way)
- In HandActionDrop class (only for drop by G key)
Comment Actions
Tell me, how long did it take you - creating code to change the task? I'm just wondering how much time you need to spend evaluating the problem and finding a fix to the problem.
This comment was removed by borizz.k.
Comment Actions
Code
modded class ItemBase extends InventoryItem { override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc) { super.EEItemLocationChanged(oldLoc,newLoc); if (newLoc.GetType() == InventoryLocationType.GROUND) { if (oldLoc.GetParent()) { PlayerBase player = PlayerBase.Cast(oldLoc.GetParent()); if (player) { FixPositionIfDropOnCar(player); } } } } void FixPositionIfDropOnCar(PlayerBase player) { vector m_RayStart; vector m_RayEnd; m_RayStart = player.GetPosition(); m_RayStart[1] = m_RayStart[1] + 0.5; m_RayEnd = m_RayStart; m_RayEnd[1] = m_RayEnd[1] - 1; RaycastRVParams m_RayCastInput = new RaycastRVParams(m_RayStart, m_RayEnd, this, 0.05); array<ref RaycastRVResult> m_RayCastResults = new array<ref RaycastRVResult>; m_RayCastInput.with = player; m_RayCastInput.flags = CollisionFlags.FIRSTCONTACT; if (DayZPhysics.RaycastRVProxy(m_RayCastInput, m_RayCastResults)) { if (m_RayCastResults.Count() > 0) { Car car; if (Class.CastTo(car, m_RayCastResults[0].obj) || Class.CastTo(car, m_RayCastResults[0].parent)) { this.SetPosition(m_RayCastResults[0].pos + (player.GetDirection() * 0.1)); } } } } }