Druring development of Ship, I would like when player is linked to this vehicle (LinkToLocalSpace) also all items which drop, craft should be automaticalle added as child to player's parent (ship). Its needed heavy modding a lot of classes. Will be very good have it prepared in vanilla.
Example howto automatically set parent dropped item:
```
modded class ItemBase extends InventoryItem
{
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
{
super.EEItemLocationChanged(oldLoc,newLoc);
if ( !GetGame().IsServer() )
{
return;
}
if (newLoc.GetType() == InventoryLocationType.GROUND)
{
if (oldLoc.GetParent())
{
PlayerBase player = PlayerBase.Cast(oldLoc.GetParent());
if (player)
{
if (player.GetParent())
{
//hrac je na lodi, je treba vzit polohu hrace vuci lodi
// pak zmenit item parent na lod
EntityAI ship = EntityAI.Cast(player.GetParent());
vector tmItem[4];
vector tmTarget[4];
vector tmLocal[4];
vector pPos = player.GetPosition();
vector pOri = player.GetOrientation();
player.GetTransform( tmItem );
PlaceOnSurfaceRotated( tmItem, pPos, 0, 0, 0, false );
ship.GetTransform( tmTarget );
Math3D.MatrixInvMultiply4( tmTarget, tmItem, tmLocal );
SetTransform( tmLocal );
ship.AddChild( this, -1 );
ship.Update();
}
}
}
}
}
}
```