Fix #1951: Disabled putting water in airplane and lorry

Removing liquid collection from the lorry is a side effect, but it is not bad. The lorry behavior was weird anyway, because you could for example put lava and wood in it, without the wood burning etc.
install-platforms
Mark 2017-12-29 12:59:36 +01:00
parent 5aea227504
commit ee0917d7e8
2 changed files with 5 additions and 1 deletions

View File

@ -269,5 +269,5 @@ protected func RejectEntrance(object into)
{
if (_inherited(into, ...)) return true;
if (into->GetAlive()) return true;
return !(into->~IsLiquidContainer() || into->~IsContainer());
return !(into->~IsLiquidContainer());
}

View File

@ -23,6 +23,7 @@
*/
#include Library_PowerConsumer
#include Library_LiquidContainer
// Production queue, a list of items to be produced.
// Contains proplists of format {Product = <objid>, Amount = <int>, Infinite = (optional)<bool>, ProducingPlayer = (optional)<int>}. /Infinite/ == true -> infinite production.
@ -920,6 +921,9 @@ public func RejectCollect(id item_id, object item)
// Is the object a container? If so, try to empty it. Don't empty extra slots.
if ((item->~IsContainer() && !item->~HasExtraSlot()) || item->~IsLiquidContainer() || item->~IsBucket())
{
// this is not optimal, because it grabs everything, even things that should not go into the producer normally:
// the function GrabContents issues no callbacks - however, please don't change the behavior of GrabContents,
// the missing callbacks are a very good thing for certain purposes
GrabContents(item);
}
// Can we collect the object itself?