This commit is contained in:
Anuken
2020-03-06 16:10:13 -05:00
17 changed files with 125 additions and 116 deletions

View File

@@ -113,17 +113,17 @@ public class Control implements ApplicationListener, Loadable{
});
//autohost for pvp maps
Events.on(WorldLoadEvent.class, event -> {
Events.on(WorldLoadEvent.class, event -> app.post(() -> {
if(state.rules.pvp && !net.active()){
try{
net.host(port);
player.admin(true);
}catch(IOException e){
ui.showException("$server.error", e);
Core.app.post(() -> state.set(State.menu));
state.set(State.menu);
}
}
});
}));
Events.on(UnlockEvent.class, e -> ui.hudfrag.showUnlock(e.content));

View File

@@ -45,7 +45,7 @@ public class NetServer implements ApplicationListener{
if(state.rules.pvp){
//find team with minimum amount of players and auto-assign player to that.
TeamData re = state.teams.getActive().min(data -> {
if(state.rules.waveTeam == data.team || !data.team.active()) return Integer.MAX_VALUE;
if((state.rules.waveTeam == data.team && state.rules.waves) || !data.team.active()) return Integer.MAX_VALUE;
int count = 0;
for(Playerc other : players){

View File

@@ -21,6 +21,7 @@ import mindustry.game.EventType.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.graphics.MultiPacker.*;
import mindustry.plugin.*;
import mindustry.type.*;
import mindustry.ui.*;

View File

@@ -91,6 +91,9 @@ public class Scripts implements Disposable{
context.evaluateString(scope, script, file, 1, null);
return true;
}catch(Throwable t){
if(currentMod != null){
file = currentMod.name + "/" + file;
}
log(LogLevel.err, file, "" + getError(t));
return false;
}

View File

@@ -73,7 +73,6 @@ public class CustomGameDialog extends FloatingDialog{
image.row();
image.add(img).size(images);
BorderImage border = new BorderImage(map.safeTexture(), 3f);
border.setScaling(Scaling.fit);
image.replaceImage(border);