forked from Mirrors/openclonk
fix switch target in horrid highway goal (#1960)
parent
7f0743a7b9
commit
72093ffa7f
|
@ -7,22 +7,21 @@
|
|||
|
||||
|
||||
#include Library_Goal
|
||||
#include Library_SwitchTarget
|
||||
|
||||
|
||||
/*-- Control --*/
|
||||
|
||||
public func OpenDoor(object switch)
|
||||
// Reaction to operation by a switch.
|
||||
public func OnSetInputSignal(object operator, object switch, bool right)
|
||||
{
|
||||
// Don't do anything here.
|
||||
return;
|
||||
}
|
||||
|
||||
public func CloseDoor(object switch)
|
||||
{
|
||||
if (!GetEffect("FxRunLocomotives", this) && !FindObject(Find_ID(Locomotive)))
|
||||
if (!right)
|
||||
{
|
||||
if (!GetEffect("FxRunLocomotives", this) && !FindObject(Find_ID(Locomotive)))
|
||||
CreateEffect(FxRunLocomotives, 100, 36, this);
|
||||
switch->ControlSwitchDir(nil, -1);
|
||||
return;
|
||||
switch->ControlSwitchDir(nil, -1);
|
||||
}
|
||||
_inherited(operator, switch, right, ...);
|
||||
}
|
||||
|
||||
local FxRunLocomotives = new Effect
|
||||
|
|
|
@ -204,7 +204,8 @@ private func InitLeftIsland()
|
|||
{
|
||||
var switch = CreateObjectAbove(Switch, 20, LandscapeHeight() / 2);
|
||||
var goal = FindObject(Find_ID(Goal_LocomotiveHighway));
|
||||
switch->SetTarget(goal);
|
||||
goal->SetPlrViewOnSignalChange(false);
|
||||
switch->SetSwitchTarget(goal);
|
||||
switch->SetSwitchDir(-1);
|
||||
|
||||
var guidepost = CreateObjectAbove(EnvPack_Guidepost2, 40, LandscapeHeight() / 2);
|
||||
|
|
Loading…
Reference in New Issue