[0.15.X][Modding] Player ejected from vehicle unexpectedly

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

[0.15.X][Modding] Player ejected from vehicle unexpectedly

Post by DedlySpyder »

In my Avatars mod, the player jumps into a car typed entity to control the avatars. When they pick an avatar to control, I switch their character for it. In 0.14.X, their original character would stay inside the car entity, now in 0.15.X their original character is ejected.

Steps to reproduce:
Place a car

(Save your character if you want to go back)

Code: Select all

/c CHARACTER=game.player.character
Spawn a player

Code: Select all

/c NEW_PLAYER=game.player.surface.create_entity{name="player", position=game.player.position}
Get inside the car

Swap to the NEW_PLAYER

Code: Select all

/c game.player.character = NEW_PLAYER

When testing like this the original character turns blue while swapped, but even if you swap back it will still be outside of the car.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15856
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.15.X][Modding] Player ejected from vehicle unexpectedly

Post by Rseding91 »

This is working as intended.

Switching the character entity switches the controller the player is using and when that happens it ejects the player from any vehicle they're in to make sure the state remains correct on the character entity, the vehicle, and the player.

In 0.14 and previous it would leave the character in an invalid state.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Not a bug”