[2.0.28] player_index missing from some `on_space_platform_built_entity` events

Bugs that are actually features.
coldarn
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Jan 07, 2025 6:52 pm
Contact:

[2.0.28] player_index missing from some `on_space_platform_built_entity` events

Post by coldarn »

Removing entities on a space platform via right-click fires the `on_space_platform_built_entity` event with `player_index` field populated in the event object.

Removing via cut action or removal blueprint does NOT include `player_index` in the event callback.

Both of these actions are performed by a player and affect the undo/redo stack, so IMO should indicate which player performed them.

Use case: updating entity tags in the undo stack after removal with data a mod needs to restore the previous game state if undo is triggered.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4140
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.28] player_index missing from some `on_space_platform_built_entity` events

Post by boskid »

That is absolutely Not a bug. on_space_platform_built_entity is raised when a space platform builds entity. Player can only request entities to be built by placing ghosts. on_space_platform_built_entity does not contain player_index for the same reason why on_robot_built_entity does not contain player_index.
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: [2.0.28] player_index missing from some `on_space_platform_built_entity` events

Post by IsaacOscar »

I had a similar problem, event.entity.last_user should hopefully give the player that built the ghost.
Post Reply

Return to “Not a bug”