Jump to content

Stack Sizes

Pending 2.2.4

dustyhansen

Posted

Why are stack sizes impacted when that part of the plugin is disabled?

I want to use a different stack size plugin since you refuse to add container-based stack sizes. But, this one overrides that one.

The_Kiiiing

Posted

What exactly does the plugin override. When stack size controller is disabled, the plugin unsubscribes from all stack size related hooks and does not change any stack sizes. 

If you are getting hook conflicts, then the stack size controller is not fully disabled

dustyhansen

Posted

15 hours ago, The_Kiiiing said:

What exactly does the plugin override. When stack size controller is disabled, the plugin unsubscribes from all stack size related hooks and does not change any stack sizes. 

If you are getting hook conflicts, then the stack size controller is not fully disabled

When I installed the plugin it literally said it was affecting stack sizes in the console. Then all my stack sizes were vanilla until I reloaded my stacks plugin. So something is broken then because it did indeed affect stack sizes and it is disabled.

The_Kiiiing

Posted

On 1/12/2026 at 11:52 AM, dustyhansen said:

When I installed the plugin it literally said it was affecting stack sizes in the console. Then all my stack sizes were vanilla until I reloaded my stacks plugin. So something is broken then because it did indeed affect stack sizes and it is disabled.

Can you please share the console output of the plugin so I know whats going on. To me this looks like the stack size controller is not fully disabled

dustyhansen

Posted

8 hours ago, The_Kiiiing said:

Can you please share the console output of the plugin so I know whats going on. To me this looks like the stack size controller is not fully disabled

Here is what it said when I installed it:

[2026.01.11 15:26:59] [INFO] [Loottable] Attempting to import legacy files
[2026.01.11 15:26:59] [ERRO] [Loottable] One or more import actions failed: EVERYTHING r:False
[2026.01.11 15:26:59] [INFO] Loaded plugin Loottable v2.2.4 by The_Kiiiing [618ms]
[2026.01.11 15:26:59] [INFO] [Loottable] Loading vanilla stack sizes from file ...
[2026.01.11 15:26:59] [INFO] [Loottable] Loaded vanilla stack sizes for 1144 items

 

The_Kiiiing

Posted

The plugin attempts to import old data files. If you previously used version 1 with stack size configuration enabled, this might be the problem. Make sure there is no Loottable folder in your oxide/data folder.

dustyhansen

Posted

On 1/24/2026 at 5:15 AM, The_Kiiiing said:

The plugin attempts to import old data files. If you previously used version 1 with stack size configuration enabled, this might be the problem. Make sure there is no Loottable folder in your oxide/data folder.

here ya go:

Quote

 

Root cause: When you toggle the stack size feature off via the UI, SetEnabled(false) only sets data.Enabled = false in memory. It does not call RevertStackSize(), which means all the item.stackable values that were modified during Initialize() → ApplyStackSize() remain changed on the item definitions. The hooks (CanStackItem, etc.) get unsubscribed, but the raw item.stackable numbers are still overwritten on the game's item definitions — so stacks.cs sees the modified values instead of vanilla ones.

RevertStackSize() is only called from Save() and Unload(), not from SetEnabled().

The fix is to make SetEnabled also apply/revert the stack sizes. Let me make that change:

 

 

The_Kiiiing

Posted

Hey — I think the AI explanation you were given is missing a key part of how this plugin actually works.

Yes, SetEnabled(false) only flips the in-memory flag — that part is correct. But the conclusion that stack sizes aren’t reverted is wrong. In this plugin, RevertStackSize() is called from Save(), and Save() is triggered whenever the UI is closed.

So the real flow is:

Disable in UI

Close UI

Save() runs

RevertStackSize() executes

Stack sizes go back to vanilla

Because of that, the stack values are not left modified after disabling — they’re reverted as part of the normal lifecycle. The scenario described (values staying overridden indefinitely) doesn’t line up with how the code actually executes.

If you’re seeing stacks not reverting, it’s almost certainly something else — leftover data in /oxide/data, another plugin touching item definitions, or the UI not completing its save cycle — not RevertStackSize() being skipped.

I’d recommend testing from a clean state before assuming the core logic is broken. If you can reproduce it step-by-step on a fresh setup, I’m happy to take a look — but right now this looks like a misdiagnosis, not a bug.

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
2.6m
Total downloads
Customers
11.3k
Customers served
Files Sold
162.2k
Total sales
Payments
3.5m
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.