mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-13 00:06:39 +00:00
add 5 second player immunity to prevent spawn kills
This commit is contained in:
@@ -756,6 +756,15 @@ export class PlayerImpl implements Player {
|
||||
}
|
||||
|
||||
public canAttack(tile: TileRef): boolean {
|
||||
if (
|
||||
this.mg.hasOwner(tile) &&
|
||||
this.mg.config().numSpawnPhaseTurns() +
|
||||
this.mg.config().spawnImmunityDuration() >
|
||||
this.mg.ticks()
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.mg.owner(tile) == this) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user