Fixed bugs with waiting for players, world border

This commit is contained in:
Anuken
2018-11-16 18:17:24 -05:00
parent 658698ed2f
commit ca5db2bff8
3 changed files with 13 additions and 4 deletions

View File

@@ -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();

View File

@@ -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(){

View File

@@ -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(){