protected virtual void PickupObject()
{
int obj = GetVarOrDirectWord(OpCodeParameter.Param1);
if (obj < 1)
{
string msg = string.Format("pickupObjectOld received invalid index {0} (script {1})", obj, Slots[CurrentScript].Number);
throw new NotSupportedException(msg);
}
if (GetObjectIndex(obj) == -1)
return;
// Don't take an object twice
if (GetWhereIsObject(obj) == WhereIsObject.Inventory)
return;
// debug(0, "adding %d from %d to inventoryOld", obj, _currentRoom);
AddObjectToInventory(obj, _roomResource);
MarkObjectRectAsDirty(obj);
PutOwner(obj, (byte)Variables[VariableEgo.Value]);
PutClass(obj, (int)ObjectClass.Untouchable, true);
PutState(obj, 1);
ClearDrawObjectQueue();
RunInventoryScript(1);
}