C#:
using Oxide.Core.Plugins;
using HarmonyLib;
using ConVar;
namespace Oxide.Plugins;
[Info("RemoveCorpse", "TheDarkens", "1.0.0")]
public class RemoveCorpse : RustPlugin
{
[AutoPatch]
[HarmonyPatch(typeof(BaseCorpse), nameof(BaseCorpse.GetRemovalTime))]
public static class BaseCorpse_GetRemovalTime_Patch
{
[HarmonyPrefix]
private static bool Prefix(BaseCorpse __instance, ref float __result)
{
if (__instance is PlayerCorpse) __result = 0f;
else __result = ConVar.Server.corpsedespawn;
return false;
}
}
}