[1.0.0][Modding] Ghost Lost in Migration When Changing Entity Type

Bugs that are actually features.
User avatar
DedlySpyder
Filter Inserter
Filter Inserter
Posts: 253
Joined: Fri Jun 20, 2014 11:42 am
Contact:

[1.0.0][Modding] Ghost Lost in Migration When Changing Entity Type

Post by DedlySpyder »

If an entity has a ghost placed, then that entity is migrated to an entity with a different type, the normal entities will be mirgated correctly but the ghosts disappear and are not migrated.

I have attached a sample mod to make this happen. The save is from the original run, where I had a "foo" and a "bar" logistic chest. A ghost and real entity of each was created. I then upgraded the version to 0.2.0, migrated "foo" to "qux", which is a container. When this version of the mod is loaded, the foo ghost is not migrated.

From the output it looks almost like the ghost is migrated, but then removed for some reason.

Image
Attachments
_migrate_bug.zip
(1.22 MiB) Downloaded 105 times
Test_0.2.0.zip
(953 Bytes) Downloaded 107 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 14265
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.0.0][Modding] Ghost Lost in Migration When Changing Entity Type

Post by Rseding91 »

Thanks for the report however that's working as intended. We decided there are too many complications and edge cases to warrant migration logic for ghost entities when their type changes.

There's this line in the code that specifically destroys ghosts that migrate types:
// simplification: ghost owned items for replacing are deleted instead
// there are too many headaches with the setup - destroy calls, etc.
If you want to get ahold of me I'm almost always on Discord.
User avatar
DedlySpyder
Filter Inserter
Filter Inserter
Posts: 253
Joined: Fri Jun 20, 2014 11:42 am
Contact:

Re: [1.0.0][Modding] Ghost Lost in Migration When Changing Entity Type

Post by DedlySpyder »

Ok, I figured it might be some quirk. Thanks for the update.
Post Reply

Return to “Not a bug”