Skip to content

OnPlayerDeath

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private object OnPlayerDeath( BasePlayer instance, HitInfo info )
{
    Puts( "OnPlayerDeath works!" );
    return null;
}

Location

  • BasePlayer::Die(HitInfo info)
csharp
//---
			if (Belt != null && ShouldDropActiveItem())
			{
				Vector3 vector = new Vector3(UnityEngine.Random.Range(-2f, 2f), 0.2f, UnityEngine.Random.Range(-2f, 2f));
				Belt.DropActive(GetDropPosition(), GetInheritedDropVelocity() + vector.normalized * 3f);
			}
			if (!WoundInsteadOfDying(info) && Interface.CallHook("OnPlayerDeath", this, info) == null)
			{
				SleepingBag.OnPlayerDeath(this);
				base.Die(info);
			}
		}
//---

Released under the MIT License.