controls: allow to put items into pushed containers via [throw]

as requested by Dmyst here http://forum.openclonk.org/topic_show.pl?pid=32082#pid32082
qteditor
David Dormagen 2016-06-19 20:23:29 +02:00
parent e490428f29
commit 890c430a17
1 changed files with 11 additions and 1 deletions

View File

@ -336,7 +336,7 @@ public func ObjectControl(int plr, int ctrl, int x, int y, int strength, bool re
// Throwing and dropping
// only if not in house, not grabbing a vehicle and an item selected
// only act on press, not release
if ((ctrl == CON_Throw || ctrl == CON_ThrowDelayed) && !house && (!vehicle || proc == "ATTACH") && !release)
if ((ctrl == CON_Throw || ctrl == CON_ThrowDelayed) && !house && (!vehicle || proc == "ATTACH" || proc == "PUSH") && !release)
{
if (contents)
{
@ -349,6 +349,16 @@ public func ObjectControl(int plr, int ctrl, int x, int y, int strength, bool re
if (contents->~QueryRejectDeparture(this))
return true;
// Quick-stash into grabbed vehicle?
if (vehicle && proc == "PUSH" && vehicle->~IsContainer())
{
CancelUse();
vehicle->Collect(contents);
if (!contents || contents->Contained() != this)
Sound("Hits::SoftTouch*", false, nil, GetOwner());
return true;
}
// just drop in certain situations
var only_drop = proc == "SCALE" || proc == "HANGLE" || proc == "SWIM";
// also drop if no throw would be possible anyway