Skip to content

OnLivestockAnimalClaim ​

Usage ​

  • Return a non-null value to override default behavior

Example Autogenerated ​

csharp
private object OnLivestockAnimalClaim( Rust.Ai.Gen2.LivestockAnimal instance, HitchTrough trough )
{
    Puts( "OnLivestockAnimalClaim works!" );
    return null;
}

Location ​

  • Rust.Ai.Gen2.LivestockAnimal::ClaimByTrough(HitchTrough trough)
csharp
public void ClaimByTrough(HitchTrough trough)
{
	if (!(trough == null) && trough.OwnerID != 0L && Interface.CallHook("OnLivestockAnimalClaim", this, trough) == null)
	{
		SetOwner(trough.OwnerID, OwnerChangeReason.Trough);
		AdoptHomeOf(trough);
	}
}

Released under the MIT License.