NullReferenceException at ItemContainer.AddItemFixed
Hi,
just looking at the plugin  and when it loads there is no problem....

but if you unload it you get :
Loaded plugin Water Works v1.0.3 by nivex 
Unloaded plugin Water Works v1.0.3 by nivex 
Creating item with less than 1 amount! (Water) 
NullReferenceException: Object reference not set to an instance of an object
  at ItemContainer.AddItem (ItemDefinition itemToCreate, System.Int32 p, System.UInt64 skin) [0x000d9] in <906b6a9cf1f54122946827376d3604ad>:0 
  at LiquidContainer.PushLiquidThroughOutputs () [0x000cd] in <906b6a9cf1f54122946827376d3604ad>:0 
  at InvokeHandlerBase`1[T].DoTick () [0x000be] in <8dd89de7d93d4126983e2692f5194aee>:0 
  at InvokeHandlerBase`1[T].LateUpdate () [0x0000c] in <8dd89de7d93d4126983e2692f5194aee>:0 
Creating item with less than 1 amount! (Water) 
NullReferenceException: Object reference not set to an instance of an object
  at ItemContainer.AddItem (ItemDefinition itemToCreate, System.Int32 p, System.UInt64 skin) [0x000d9] in <906b6a9cf1f54122946827376d3604ad>:0 
  at LiquidContainer.PushLiquidThroughOutputs () [0x000cd] in <906b6a9cf1f54122946827376d3604ad>:0 
  at InvokeHandlerBase`1[T].DoTick () [0x000be] in <8dd89de7d93d4126983e2692f5194aee>:0 
  at InvokeHandlerBase`1[T].LateUpdate () [0x0000c] in <8dd89de7d93d4126983e2692f5194aee>:0 
Loaded plugin Water Works v1.0.3 by nivex ​

maybe ... just maybe.. this also corrupts  the savefile for the map.
in that once the plugin is run, you cannot unload it until you use a map with a save file BEFORE the initial load.

Now this *might* be a conflict with another plugin.

But i dont think so... since there are no other plugins loaded

post your config
Hi,
I stopped using it..  ,config was default config....
normally i run the plugins default for a few hours before changing anything.
once  i saw issues I dumped the VM, no need to keep it around...

but yes.. once a save file is written out that's it....
could have been savefile written out with plugin .. reboot without plugin,
just tested with no issues. i need more details. such as which items did you deploy before reloading the plugin?

i fail to see how the items amount was set to 0 or below during creation causing this error to be thrown in the first place. not possible during unload in any scenario (all values are greater than 0) and not possible during load with a default config either (all values also greater than 0)

Creating item with less than 1 amount! (Water)​

definition Water has its value reset to 249999 when the plugin unloads. certainly seems to be a Rust bug, and likely was fixed with the previous Rust update since I'm not able to reproduce any such bug
ill try & throw in a test server agian.......
it occurs when rust lays down a new item that "contains"water....
the parent goes in first, then the child items into the list, if the quantity is zero then the list is empty
and its that  point the error is created....
i thought perhaps "createitem" or spawn might be the cause before the child goes in, 
it's lazy a** programming in rust...
ok....
had a look at this... it might be casued on server restart.
if one of the config files is missing/damaged.. AND players have the water items already in the map.

it HAS to be on a server restart.. so that RUST brings up the system with defaults of rust.

Merged post

ok... this is a crazy interraction...
it might also depend on when the plugin is installed on themap.
if items are spawned with the plugin  loaded or if they are spawned when not loaded.
and the trigger is unloading..

but the absolute cause of this is:
lc.inventory.maxStackSize = num;​

Remove this line BEFORE the map save file corrupts and there is absolutly no problems with corruption
Put it back or spawn items with it in & the bug come out.

config file is default.


Merged post

i'm just wondering....... if the  value storage size has been changed on a recent update & the value is "overflowing"
ok...... hahahahaha.... found it.....
It's a bug...
its seems to be related to  FP moving fluids in & out of the contaniers.

lc.inventory.maxStackSize = num;​

is not "the cause", it is the root of a trigger, becasue it  can be called at any time rather than when a container first gets instigated.
(like when it  undos the plugin mods)
I can get it on even a small virgin map of 1,000 and only this plugin... with default config.
still not 100% sure what is going on, but it requires, moving water thru multiple containers.
items not linked or not moving fluids don't seem to trigger it..



Merged post

Ok the following may be able to trigger it:

1. make a small map
2.  DO NOT load plugin.
3. add water barrels  / water purifiers,  wire them up, get them working.
4. load plugin.
5. set some larger than default  sizes.
6. let the shit fill up (so don't go mad in 5.)
7. unload the plugin.
8. Change sizes SMALLER.
9. relaod plugin.
10. run for a munute or so.
11 unload plugin.

Merged post

yep.. it's taking the maths negative for the water pipe movers...
unload plugin
set the water purifier to 25000, with inputs /power/ off
let it fill up.
unload plugin
set WP to 24999
load plugin/unload & errors are thrown
use a container remove liquid to BELOW 24999 & all the errors go away.
@razorfishsl

not sure why I didn't respond to this. thanks for looking into it

I believe this is an easy fix if you'd like to try it out:

find:

var purifier = lc as WaterPurifier;

add below that line:

purifier.stopWhenOutputFull = true;

it's all good....
I'm surprised no one else has run into it....

you can get your server back up, by increasing the amonut back to the initial value.
physically removing the objects will trash the users  infrastructure.

OR you can go to each users water storage device and physically remove the water to below the  config value...
just go in with vanish and "steal" the water to a  Blue water jug.
this will take the maths positive again, when the rust system adds water units to the container.

vJCprWXdKnOOrQ6.jpg razorfishsl

you can get your server back up, by increasing the amonut back to the initial value.
physically removing the objects will trash the users  infrastructure.

OR you can go to each users water storage device and physically remove the water to below the  config value...
just go in with vanish and "steal" the water to a  Blue water jug.
this will take the maths positive again, when the rust system adds water units to the container.

it was just 1000x easier to just wipe everysons jugs.

Locked automatically