Jump to content

CanStackItem conflict with other plugins (console spam)

Pending 2.2.28

Notz
Notz

Posted (edited)

Hi The_Kiiiing,

First of all, thanks for the great work on Loottable.

I'm running Loottable v2.2.28 together with SkillTreeItems, and my console is flooded with this warning every time an item is stacked or moved:

Calling hook CanStackItem resulted in a conflict between the following plugins: Loottable - True (Boolean), SkillTreeItems (False (Boolean))
 

Cause

When the Stack Size Controller is enabled, Loottable subscribes to CanStackItem. If an item pair passes all the checks, the hook ends with an explicit return true;. Any other plugin that legitimately returns false for the same hook (SkillTreeItems in my case) will conflict with it, and Oxide logs a warning on every call. Since the hook fires very often, the console becomes unusable. It also means the final result depends on plugin execution order, so SkillTreeItems' block may not always be respected.
 

Suggested fix

At the end of the hook, return true only when one of the "Stacking options" actually needs to override vanilla behavior. Otherwise return null and let the game (and other plugins) decide:

if (stackSizeController.LimitHotBarStackSize && IsInHotBar(self) && !stackSizeController.IsVanillaStackable(self)) 
{ 
	return false; 
} 

// Only force "true" if an option requires bypassing vanilla logic 
if (Config.StackingOptions.IgnoreNames || Config.StackingOptions.IgnoreText || Config.StackingOptions.IgnoreFullCondition) 
{ 
	return true; 
} 

return null;

 

With the default config, a plain return true; gives the same result as vanilla, so returning null there changes nothing for stacking behavior, and it removes the conflict. I've applied this locally and the spam is gone, with no side effects so far.
 

Remaining case

If a server enables any of those three options, Loottable still has to return true and the conflict can still occur. A possible improvement would be to expose an API/hook or a blacklist so other plugins can mark items that Loottable should not touch.

Let me know if you need any more info or logs. Thanks!

 

Captura de pantalla 2026-12-01 072906.png

Edited by Notz

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
176.8k
Total sales
Payments
3.9m
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.