mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-13 07:44:52 +00:00
refactored alliance
This commit is contained in:
@@ -208,7 +208,7 @@ export class ClientGame {
|
||||
if (tile.owner() == this.myPlayer) {
|
||||
return
|
||||
}
|
||||
if (tile.owner().isPlayer() && this.myPlayer.alliedWith(tile.owner() as Player)) {
|
||||
if (tile.owner().isPlayer() && this.myPlayer.isAlliedWith(tile.owner() as Player)) {
|
||||
this.eventBus.emit(new DisplayMessageEvent("Cannot attack ally", MessageType.WARN))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ export class NameLayer implements Layer {
|
||||
}
|
||||
|
||||
const myPlayer = this.getPlayer()
|
||||
if (myPlayer != null && myPlayer.alliedWith(render.player)) {
|
||||
if (myPlayer != null && myPlayer.isAlliedWith(render.player)) {
|
||||
context.drawImage(
|
||||
this.allianceIconImage,
|
||||
nameCenterX - iconSize / 2,
|
||||
|
||||
@@ -260,7 +260,7 @@ export class UILayer implements Layer {
|
||||
return
|
||||
}
|
||||
|
||||
if (myPlayer.alliedWith(owner)) {
|
||||
if (myPlayer.isAlliedWith(owner)) {
|
||||
options.push({
|
||||
label: "Break Alliance",
|
||||
action: (): void => {
|
||||
|
||||
Reference in New Issue
Block a user