mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-25 04:22:44 +00:00
fixed surrounded by ally bug, right click out of map bug
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user