Add ControlThrow callback into objects that want to implement custom throwing or even non-throw actions on the throw key.

shapetextures
Sven Eberhardt 2015-09-13 13:04:18 -04:00
parent 889a8dbdf9
commit 0e085e435b
1 changed files with 6 additions and 1 deletions

View File

@ -380,7 +380,12 @@ public func ObjectControl(int plr, int ctrl, int x, int y, int strength, bool re
if ((ctrl == CON_Throw || ctrl == CON_ThrowDelayed || ctrl == CON_Drop) && !house && (!vehicle || proc == "ATTACH") && !release)
{
if (contents)
{
{
// Object overloaded throw control?
// Call this before QueryRejectDeparture to allow alternate use of non-droppable objects
if (contents->~ControlThrow(this))
return true;
// The object does not want to be dropped? Still handle command.
if (contents->~QueryRejectDeparture(this))
return true;