Jump to content

OnEntityTakeDamage(BasePlayer, HitInfo)

Pending 2.0.182

IIIaKa
IIIaKa

Posted

Carbon v2.0.182.0

Hello. For some reason, the overload OnEntityTakeDamage(BasePlayer, HitInfo) has stopped working and damage to BasePlayer is now being handled directly by OnEntityTakeDamage(BaseCombatEntity, HitInfo).

IIIaKa

Posted (edited)

During server startup, I received 2 errors several times and there are no Harmony patches from any plugins until the server is fully loaded(OnServerInitialized), and everything works perfectly on Oxide.

Error while patching hook 'OnPlayerDeath[1ed550]' (Invalid IL code in (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:BasePlayer.Die_Patch0 (BasePlayer,HitInfo): IL_0112: ret

)
   at MethodInfo HarmonyLib.PatchFunctions.UpdateWrapper(MethodBase original, PatchInfo patchInfo)
   at MethodInfo HarmonyLib.PatchProcessor.Patch()
   at MethodInfo HarmonyLib.Harmony.Patch(MethodBase original, HarmonyMethod prefix, HarmonyMethod postfix, HarmonyMethod transpiler, HarmonyMethod finalizer)
   at bool Carbon.Hooks.HookEx.ApplyPatch() in /__w/Carbon/Carbon/Carbon.Core/Carbon/src/Hooks/HookEx.cs:line 173
A general error occured while installing 'OnPlayerDeath[1ed550]'

Error while patching hook 'CanAssignBed[6f1c80]' (Invalid IL code in (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:SleepingBag.AssignToFriend_Patch0 (SleepingBag,BaseEntity/RPCMessage): IL_0265: ret

)
   at MethodInfo HarmonyLib.PatchFunctions.UpdateWrapper(MethodBase original, PatchInfo patchInfo)
   at MethodInfo HarmonyLib.PatchProcessor.Patch()
   at MethodInfo HarmonyLib.Harmony.Patch(MethodBase original, HarmonyMethod prefix, HarmonyMethod postfix, HarmonyMethod transpiler, HarmonyMethod finalizer)
   at bool Carbon.Hooks.HookEx.ApplyPatch() in /__w/Carbon/Carbon/Carbon.Core/Carbon/src/Hooks/HookEx.cs:line 173
A general error occured while installing 'CanAssignBed[6f1c80]'


R1LQK7I.png

iaYnrE4.png

Edited by IIIaKa
IIIaKa

Posted

Just now, Raul-Sorin Sorban said:

Currently investigating.

I figured it out, if I moved the method 'object OnEntityTakeDamage(BaseCombatEntity)' after all the other OnEntityTakeDamage overloads, it started being called correctly.

qRcQCdN.png

  • Administrator
Raul-Sorin Sorban

Posted

Yes, it takes priority. There is in fact an issue where if that BaseCombatEntity overload returns null, it will still not fire the following overloads. Although if you change the return type from object to void, it'll fire correctly as well. Fixing this on our end, although your plugin doesn't need to return an object since the BaseCombatEntity overload always returns null.

IIIaKa

Posted

14 minutes ago, Raul-Sorin Sorban said:

Yes, it takes priority. There is in fact an issue where if that BaseCombatEntity overload returns null, it will still not fire the following overloads. Although if you change the return type from object to void, it'll fire correctly as well. Fixing this on our end, although your plugin doesn't need to return an object since the BaseCombatEntity overload always returns null.

I changed from object to void and now it's being called in two methods. I don't think this is correct at all. In Oxide, overloads work without any issues, regardless of their position in the plugin.

dITuNFu.png

  • Administrator
Raul-Sorin Sorban

Posted (edited)

Patch errors have been fixed. A reboot of the server is required.

Edited by Raul-Sorin Sorban
  • Love 1
Stewie

Posted

22 minutes ago, Raul-Sorin Sorban said:

Patch errors have been fixed. A reboot of the server is required.

 Carbon Release is up to date, no self-updating necessary. Running Production build [2.0.182] on tag 'production_build'.
 Initialized Carbon.Startup 2.0.182.0
 Preloaded Carbon.Compat 2.0.182.0

Is that expected @Raul-Sorin Sorban

  • Administrator
Raul-Sorin Sorban

Posted

Yes. It's not a Carbon update, it's the hooks that get automatically updated.

1.7m

Downloads

Total number of downloads.

7.9k

Customers

Total customers served.

119.1k

Files Sold

Total number of files sold.

2.4m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.