Do not display grab interaction when swimming (unless clonk returns true on CanGrabUnderwater callback)

shapetextures
Sven Eberhardt 2016-01-15 08:54:50 -05:00
parent 26084af502
commit 44f913d0e5
1 changed files with 4 additions and 0 deletions

View File

@ -378,6 +378,10 @@ func GetInteractableObjects(array sort)
if (interactable->GetOCF() & OCF_Grab)
{
var priority = 19;
// not if swimming because the grab command cannot really fix that (unlike e.g. scale/hangle)
if (GetProcedure() == "SWIM")
if (!this->~CanGrabUnderwater(interactable)) // unless it's a special clonk that can grab underwater. It needs to define a callback then.
continue;
// high priority if already grabbed
if (GetActionTarget() == interactable) priority = 0;