Fix: Handle not spawned player focus (#1186)

## Description:
Implementing the fix for #1184

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

dovg
This commit is contained in:
tnhnblgl
2025-06-17 04:35:42 +03:00
committed by GitHub
parent 0e56213b9a
commit 936b43bedc
+5 -4
View File
@@ -152,10 +152,11 @@ export class TransformHandler {
onGoToPlayer(event: GoToPlayerEvent) {
this.game.setFocusedPlayer(event.player);
this.clearTarget();
this.target = new Cell(
event.player.nameLocation().x,
event.player.nameLocation().y,
);
const nameLocation = event.player.nameLocation();
if (!nameLocation) {
return;
}
this.target = new Cell(nameLocation.x, nameLocation.y);
this.intervalID = setInterval(() => this.goTo(), GOTO_INTERVAL_MS);
}