void PickupObject()
{
int obj = GetVarOrDirectWord(OpCodeParameter.Param1);
if (obj < 1)
{
throw new InvalidOperationException(
string.Format("pickupObject received invalid index {0} (script {1})", obj, Slots[CurrentScript].Number));
}
if (GetObjectIndex(obj) == -1)
return;
if (GetWhereIsObject(obj) == WhereIsObject.Inventory) /* Don't take an */
return; /* object twice */
AddObjectToInventory(obj, _roomResource);
MarkObjectRectAsDirty(obj);
PutOwner(obj, (byte)Variables[VariableEgo.Value]);
PutState(obj, GetStateCore(obj) | (byte)ObjectStateV2.State8 | (byte)ObjectStateV2.Untouchable);
ClearDrawObjectQueue();
RunInventoryScript(1);
// if (Game.Platform == Platform.NES)
// Sound.AddSoundToQueue(51); // play 'pickup' sound
}