Disallow interaction menu on hostile and neutral clonks

Stealing items in melees or taking quest items from NPCs is a bit odd.
console-destruction
Sven Eberhardt 2016-08-30 19:54:58 -04:00
parent 4c56b41de0
commit cd4e419aef
3 changed files with 15 additions and 0 deletions

View File

@ -545,3 +545,16 @@ public func SetMaxContentsCount(int new_count)
this->~OnInventoryChange();
return true;
}
/* Objects with inventory (i.e. clonks) do not allow taking out items by hostile clonks.
Also do not allow for neutral, because that will affect NPCs */
public func RejectInteractionMenu(object clonk, ...)
{
var msg = _inherited(clonk, ...);
if (!msg)
{
if (GetOwner() == NO_OWNER || Hostile(GetOwner(), clonk->GetOwner()))
return Format("$MsgNoInteraction$", GetName());
}
return msg;
}

View File

@ -0,0 +1 @@
MsgNoInteraction=%s erlaubt keine Interaktion.

View File

@ -0,0 +1 @@
MsgNoInteraction=%s does not allow interaction.