Skip to content

Make teleports move the player again on 2.1 - #1681

Merged
grilledham merged 1 commit into
Refactorio:developfrom
lex:fix-teleport-remote-view
Nov 10, 2026
Merged

grilledham merged 1 commit into
Refactorio:developfrom
lex:fix-teleport-remote-view

Conversation

@lex

@lex lex commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Players reported that the Teleport button on train stations stopped working on 2.1: clicking it centres the view on the destination station and prints "You have been teleported", but the player stays where they were. Admins said /tp doesn't work either.

On 2.1, LuaPlayer.teleport moves only the camera while the player is looking at the map, which is where a far station's window is opened from. Teleporting the player's character (player.character.teleport) moves the character even while the player is looking at the map, also to another surface. New code that moves a player should use Utils.teleport_player.

Changes

  • Utils.teleport_player(player, position, surface, raise_teleported) in utils/core.lua teleports the player's character, or the player when they have none (god, spectator, dead).
  • Used by the train station Teleport button (its success message prints after the teleport), /tp (selected entity, player, and tp mode), /invoke, the train saviour, the antigrief surface switch (from the physical position and surface), Frontier's lobby, spawn control, and the Space Race, Quadrants, Tetris and Dimensions teleports.

Tests

Five skip-headless tests, since they need a player:

  • utils/Core/teleport_player: from the map, the character moves and the view stays; from the map, the character moves to another surface; a player with no character is teleported.
  • features/admin_commands: /tp on a chest selected from the map moves the character to it.
  • features/train_station_teleport: clicking Teleport on a far station opened from the map moves the character to it.

All five pass in a 2.1.24 client, and the four map tests fail with LuaPlayer.teleport in the helper. Headless Frontier and Diggy pass. luacheck: 0 warnings / 0 errors.

🤖 Generated with Claude Code

@lex
lex force-pushed the fix-teleport-remote-view branch from 4b54b0f to 5389075 Compare November 9, 2026 19:28
Players reported that the Teleport button on train stations stopped
working on 2.1: it centred the view on the station and said "You have
been teleported", but the player stayed where they were. Admins said
/tp didn't work either.

On 2.1, LuaPlayer.teleport moves only the camera while the player is
looking at the map, which is where a far station's window is opened
from. Utils.teleport_player teleports the player's character instead,
or the player when they have none (god, spectator, dead).

The train station button, /tp, /invoke, the train saviour, the
antigrief surface switch, Frontier's lobby, spawn control and the Space
Race, Quadrants, Tetris and Dimensions teleports use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lex
lex force-pushed the fix-teleport-remote-view branch from 5389075 to 81ab242 Compare November 9, 2026 19:36
@lex lex changed the title Teleport the character, not the map view Make teleports move the player again on 2.1 Nov 9, 2026
@grilledham
grilledham merged commit e3efc2d into Refactorio:develop Nov 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants