mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-11 11:17:11 +07:00
Fixed attack mode gamover check
This commit is contained in:
parent
23673f0b11
commit
436a020c3e
@ -199,19 +199,13 @@ public class Logic implements ApplicationListener{
|
||||
state.gameOver = true;
|
||||
Events.fire(new GameOverEvent(state.rules.waveTeam));
|
||||
}else if(state.rules.attackMode){
|
||||
Team alive = null;
|
||||
//count # of teams alive
|
||||
int countAlive = state.teams.getActive().count(TeamData::hasCore);
|
||||
|
||||
for(TeamData team : state.teams.getActive()){
|
||||
if(team.hasCore()){
|
||||
if(alive != null){
|
||||
return;
|
||||
}
|
||||
alive = team.team;
|
||||
}
|
||||
}
|
||||
|
||||
if(alive != null && !state.gameOver){
|
||||
Events.fire(new GameOverEvent(alive));
|
||||
if((countAlive <= 1 || (!state.rules.pvp && state.rules.defaultTeam.core() == null)) && !state.gameOver){
|
||||
//find team that won
|
||||
TeamData left = state.teams.getActive().find(TeamData::hasCore);
|
||||
Events.fire(new GameOverEvent(left == null ? Team.derelict : left.team));
|
||||
state.gameOver = true;
|
||||
}
|
||||
}
|
||||
|
@ -113,8 +113,9 @@ public class MinimapFragment extends Fragment{
|
||||
public void toggle(){
|
||||
float size = baseSize * zoom * world.width();
|
||||
float ratio = (float)renderer.minimap.getTexture().height / renderer.minimap.getTexture().width;
|
||||
panx = (size/2f - player.x() / (world.width() * tilesize) * size) / zoom;
|
||||
pany = (size*ratio/2f - player.y() / (world.height() * tilesize) * size*ratio) / zoom;
|
||||
float px = player.dead() ? Core.camera.position.x : player.x, py = player.dead() ? Core.camera.position.y : player.y;
|
||||
panx = (size/2f - px / (world.width() * tilesize) * size) / zoom;
|
||||
pany = (size*ratio/2f - py / (world.height() * tilesize) * size*ratio) / zoom;
|
||||
shown = !shown;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user