Collects an object. This function performs the same events as they occur if the object is collected in the game through the
Collection area (there will be a RejectCollect call, flag collection checks, hit calls e.g.
OCF_HitSpeed2, etc.). The only difference is that there will be no comparison of collection position and the collected item is not checked
for the
OCF_Collectible flag.
Using this function you can for example collect objects directly from a container. If the function fails (e.g. through a RejectCollect
or a full target container) the function returns 0, otherwise 1.
protected func ControlDig (pClonk)
{
var obj; if (!(obj = Contents())) return(1);
if (!Collect(obj, pClonk)) Message("Herausnehmen nicht möglich", pClonk);
return(1);
}
With keyboard command Dig the first inventory object is passed to the selected clonk.