Ejemplo n.º 1
0
            public static bool AskDamage(Animal __instance, ref ushort amount, ref Vector3 newRagdoll, // lgtm [cs/too-many-ref-parameters]
                ref ERagdollEffect ragdollEffect, ref bool trackKill, ref bool dropLoot)
            {
                var cancel = false;

                if (amount == 0 || __instance.isDead) return false;

                OnAnimalDamaging?.Invoke(__instance, ref amount, ref newRagdoll, ref ragdollEffect, ref trackKill,
                    ref dropLoot, ref cancel);

                return !cancel;
            }
Ejemplo n.º 2
0
            private static bool AskDamage(Animal __instance, ref ushort amount, ref Vector3 newRagdoll,
                                          ref ERagdollEffect ragdollEffect, ref bool trackKill, ref bool dropLoot)
            {
                bool cancel = false;

                if (amount == 0 || __instance.isDead)
                {
                    return(false);
                }

                OnAnimalDamaging?.Invoke(__instance, ref amount, ref newRagdoll, ref ragdollEffect, ref trackKill,
                                         ref dropLoot, out cancel);

                return(!cancel);
            }