Jump to content

When items DropObject() they're stealing?


louisthird

Recommended Posts

I have the player drop an item and a companion pick it up. When I have that same companion use DropObject() on that item, the item is marked as stealing for the player. Why? This has something to do with the Owner of the item I think. If that is not the proper way to drop an item to keep the correct owner as not stealing, then what would be the proper way?

Link to comment
Share on other sites

Answering my own question: this function works for dropping and adjusts if you pass an item reference or base form:

 

ObjectReference Function DropItem(ObjectReference akSenderRef, Form akBaseItem, Int aiItemCount, ObjectReference akItemReference)
  Actor actorOwner = akSenderRef as Actor
  ObjectReference droppedObject
  If akItemReference != None
    akItemReference.Drop(true)
    droppedObject = akItemReference
  Else
    droppedObject = akSenderRef.DropObject(akBaseItem, aiItemCount)
  EndIf
  If droppedObject != None
    droppedObject.SetActorRefOwner(actorOwner, true)
  EndIf
  return droppedObject
EndFunction
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...