[boskid][2.1.20] Crash after game.merge_forces when a character of the merged force is in a vehicle

This subforum contains all the issues which we already resolved.
artemlisonok
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Jun 07, 2025 2:23 am
Contact:

[boskid][2.1.20] Crash after game.merge_forces when a character of the merged force is in a vehicle

Post by artemlisonok »

What did you do?
Ran attached scenario. merge-crash-minimal.zip - for client, merge-crash-minimal-server.zip - for server

What happened?
The game crashed on the next tick. Client: Car::draw → Character::getPlayerColor → ForceData::getColor. Headless server: Character::update → Character::isLootInReach.

What should have happened?
The car and its driver should be moved to the player force, like any other entity of the merged force.

Does it happen always, once, or sometimes?
Always.

I think game.merge_forces does not reassign characters sitting in vehicles, so they keep a reference to the deleted force. Characters on foot are reassigned fine.
Attachments
merge-crash-minimal.zip
(750 Bytes) Downloaded 12 times
factorio-dump-current.dmp
(1.15 MiB) Downloaded 14 times
factorio-current.log
(12.88 KiB) Downloaded 13 times
merge-crash-minimal-server.zip
(808 Bytes) Downloaded 13 times
factorio-dump-current-server.dmp
(1007.34 KiB) Downloaded 12 times
factorio-current-server.log
(8.15 KiB) Downloaded 10 times
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4949
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [boskid][2.1.20] Crash after game.merge_forces when a character of the merged force is in a vehicle

Post by boskid »

Thanks for the report. Issue is now fixed for 2.1.21.
Post Reply

Return to “Resolved Problems and Bugs”