fixed surrounded by ally bug, right click out of map bug

This commit is contained in:
evanpelle
2024-09-20 19:37:43 -07:00
parent 03a7c4b543
commit d8cb5b1847
3 changed files with 19 additions and 12 deletions
+7 -4
View File
@@ -28,10 +28,10 @@ export class UILayer implements Layer {
constructor(
private eventBus: EventBus,
private game: Game,
private clientID: ClientID,
private transformHandler: TransformHandler
) {
private game: Game,
private clientID: ClientID,
private transformHandler: TransformHandler
) {
}
@@ -229,6 +229,9 @@ export class UILayer implements Layer {
private onRightClick(e: RightClickEvent) {
const cell = this.transformHandler.screenToWorldCoordinates(e.x, e.y)
if (!this.game.isOnMap(cell)) {
return
}
const tile = this.game.tile(cell)
if (!tile.hasOwner()) {
return