mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-20 12:32:53 +00:00
fix bad tile crash (#1237)
## Description: Sending invalid coords can cause game to crash. Make sure to validate tile ref. ## 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: evan
This commit is contained in:
@@ -48,13 +48,13 @@ export class PlayerActionHandler {
|
||||
handleBoatAttack(
|
||||
player: PlayerView,
|
||||
targetId: PlayerID | null,
|
||||
targetCell: Cell,
|
||||
spawnTile: Cell | null,
|
||||
targetTile: TileRef,
|
||||
spawnTile: TileRef | null,
|
||||
) {
|
||||
this.eventBus.emit(
|
||||
new SendBoatAttackIntentEvent(
|
||||
targetId,
|
||||
targetCell,
|
||||
targetTile,
|
||||
this.uiState.attackRatio * player.troops(),
|
||||
spawnTile,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user