From ee0917d7e8983a653278ddc532e80ad38289bf7c Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 29 Dec 2017 12:59:36 +0100 Subject: [PATCH] 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. --- .../Libraries.ocd/LiquidControl.ocd/Liquid.ocd/Script.c | 2 +- .../Libraries.ocd/Structures.ocd/Producer.ocd/Script.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/planet/Objects.ocd/Libraries.ocd/LiquidControl.ocd/Liquid.ocd/Script.c b/planet/Objects.ocd/Libraries.ocd/LiquidControl.ocd/Liquid.ocd/Script.c index 96818d9d8..d7591fbaa 100644 --- a/planet/Objects.ocd/Libraries.ocd/LiquidControl.ocd/Liquid.ocd/Script.c +++ b/planet/Objects.ocd/Libraries.ocd/LiquidControl.ocd/Liquid.ocd/Script.c @@ -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()); } diff --git a/planet/Objects.ocd/Libraries.ocd/Structures.ocd/Producer.ocd/Script.c b/planet/Objects.ocd/Libraries.ocd/Structures.ocd/Producer.ocd/Script.c index dd4cde2ab..9e39b3f8b 100644 --- a/planet/Objects.ocd/Libraries.ocd/Structures.ocd/Producer.ocd/Script.c +++ b/planet/Objects.ocd/Libraries.ocd/Structures.ocd/Producer.ocd/Script.c @@ -23,6 +23,7 @@ */ #include Library_PowerConsumer +#include Library_LiquidContainer // Production queue, a list of items to be produced. // Contains proplists of format {Product = , Amount = , Infinite = (optional), ProducingPlayer = (optional)}. /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?