Fixed bugs with waiting for players, world border
This commit is contained in:
@@ -125,7 +125,7 @@ public class Logic extends Module{
|
||||
}
|
||||
|
||||
private void updateSectors(){
|
||||
if(world.getSector() == null) return;
|
||||
if(world.getSector() == null || state.gameOver) return;
|
||||
|
||||
world.getSector().currentMission().update();
|
||||
|
||||
|
||||
@@ -412,7 +412,16 @@ public class NetServer extends Module{
|
||||
}
|
||||
|
||||
public boolean isWaitingForPlayers(){
|
||||
return state.mode.isPvp && playerGroup.size() < 2;
|
||||
if(state.mode.isPvp){
|
||||
int used = 0;
|
||||
for(Team t : Team.all){
|
||||
if(playerGroup.count(p -> p.getTeam() == t) > 0){
|
||||
used ++;
|
||||
}
|
||||
}
|
||||
return used < 2;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void update(){
|
||||
|
||||
@@ -550,8 +550,8 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
|
||||
updateBuilding(this);
|
||||
|
||||
x = Mathf.clamp(x, 0, world.width() * tilesize);
|
||||
y = Mathf.clamp(y, 0, world.height() * tilesize);
|
||||
x = Mathf.clamp(x, tilesize, world.width() * tilesize - tilesize);
|
||||
y = Mathf.clamp(y, tilesize, world.height() * tilesize - tilesize);
|
||||
}
|
||||
|
||||
protected void updateMech(){
|
||||
|
||||
Reference in New Issue
Block a user