From 8889a681274189ec1928b2512f25819a84f5def2 Mon Sep 17 00:00:00 2001 From: Maikel de Vries Date: Mon, 29 Jan 2018 10:14:53 +0100 Subject: [PATCH] horrid highway: fade out trains if they are taking too long --- .../HorridHighway.ocs/LocomotiveHighway.ocd/Script.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/planet/Worlds.ocf/HorridHighway.ocs/LocomotiveHighway.ocd/Script.c b/planet/Worlds.ocf/HorridHighway.ocs/LocomotiveHighway.ocd/Script.c index ea1dca378..837cd9e6a 100644 --- a/planet/Worlds.ocf/HorridHighway.ocs/LocomotiveHighway.ocd/Script.c +++ b/planet/Worlds.ocf/HorridHighway.ocs/LocomotiveHighway.ocd/Script.c @@ -18,7 +18,7 @@ public func OnSetInputSignal(object operator, object switch, bool right) if (!right) { if (!GetEffect("FxRunLocomotives", this) && !FindObject(Find_ID(Locomotive))) - CreateEffect(FxRunLocomotives, 100, 36, this); + CreateEffect(FxRunLocomotives, 100, 36, this); switch->ControlSwitchDir(nil, -1); } _inherited(operator, switch, right, ...); @@ -85,6 +85,11 @@ local FxCheckLocomotive = new Effect Target->RemoveObject(); return FX_Execute_Kill; } + if (time > this.time_allowed) + { + Target->FadeOut(18, true); + return FX_Execute_Kill; + } return FX_OK; } };