Jump to content

Regarding implementations that include `.PatchAll` in the code

Pending 1.2.5

hid333
hid333

Posted

Could you please revise the implementation—specifically the parts involving .PatchAll—by referring to the discussion below?

ttps://codefling.com/files/support/23607-red-text-error/

 

Issue (Line 147):

harmony = new Harmony("krunghcrow.better.npc.names");
harmony.PatchAll();

Using PatchAll() can unintentionally apply Harmony patches belonging to other plugins, since Oxide may compile multiple plugins into the same assembly.

This can cause duplicate patches or conflicts with other plugins, particularly those using Harmony for custom item definitions.

Suggested Fix:

Instead of PatchAll(), use CreateClassProcessor() to apply only the three Harmony patch classes belonging to BetterNpcNames:

  • ScientistNPC_DisplayName
  • UnderwaterDweller_DisplayName
  • TunnelDweller_DisplayName

This should preserve the plugin's functionality while preventing unintended interference with other plugins.

I encountered a Load invalid item id (no ItemDefinition found) error while using custom items. Although I cannot confirm that BetterNpcNames caused it, this Harmony implementation is a possible contributing factor.

I would appreciate it if you could review and consider updating the patch registration method.

Thank you for your work!

 

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
3.3m
Total downloads
Customers
12.4k
Customers served
Files Sold
175.6k
Total sales
Payments
3.8m
Processed total
×
×
  • 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.