[2.1.8] Error requesting fluid box prototype of ghost

This subforum contains all the issues which we already resolved.
robot256
Smart Inserter
Smart Inserter
Posts: 1372
Joined: Sun Mar 17, 2019 1:52 am
Contact:

[2.1.8] Error requesting fluid box prototype of ghost

Post by robot256 »

When I build a ghost pipe next to a real pipe, the following happens:

On the pipe entity, get_fluid_box_neighbours(1) returns a connection with target=the ghost-entity containing the ghost pipe.

On the ghost pipe entity, get_fluid_box_prototype(1) causes an error, "Unable to create LuaFluidBoxPrototype for entity-ghost from a given FluidBoxPrototype pointer 0x00000283405f24e8".

On the ghost pipe entity, ghost_prototype.fluidbox_prototypes[1] returns the LuaFluidBoxPrototype object I need.

I was expecting at least the prototype method to be redirected to the inner entity of the ghost. I'm not really surprised that a ghost does not have a full LuaFluidBox object, and there is an easy workaround.

If this behavior is intentional, then I think the error message could be improved to something like "Cannot read fluid box from ghost pipe". And I would suggest it be added to the LuaEntity page which get_fluid_box_* methods do not work on ghosts.
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
Rseding91
Factorio Staff
Factorio Staff
Posts: 17037
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.1.8] Error requesting fluid box prototype of ghost

Post by Rseding91 »

Thanks for the report. This is now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”