Skip to content

CanTrainCarCouple

Usage

  • Return a bool value to override default behavior

Example Autogenerated

csharp
private bool? CanTrainCarCouple( TrainCar owner, TrainCar owner2 )
{
    Puts( "CanTrainCarCouple works!" );
    return null;
}

Location

  • TrainCoupling::TryCouple(TrainCoupling theirCoupling, bool reflect)
csharp
//---
	}
	if (IsCoupled)
	{
		return false;
	}
	object obj = Interface.CallHook("CanTrainCarCouple", owner, theirCoupling.owner);
	if (obj is bool)
	{
		return (bool)obj;
	}
	if (reflect && !theirCoupling.TryCouple(this, reflect: false))
//---

Released under the MIT License.