forked from Mirrors/openclonk
controls: allow to put items into pushed containers via [throw]
as requested by Dmyst here http://forum.openclonk.org/topic_show.pl?pid=32082#pid32082qteditor
parent
e490428f29
commit
890c430a17
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue