mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-11 11:17:11 +07:00
Bugfixes for 78.1
This commit is contained in:
parent
e7fb128499
commit
0f519fd358
@ -7,6 +7,7 @@ import io.anuke.arc.Events;
|
||||
import io.anuke.arc.collection.ObjectSet.ObjectSetIterator;
|
||||
import io.anuke.arc.util.Time;
|
||||
import io.anuke.mindustry.content.Fx;
|
||||
import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.entities.*;
|
||||
import io.anuke.mindustry.entities.type.Player;
|
||||
@ -15,7 +16,6 @@ import io.anuke.mindustry.game.EventType.*;
|
||||
import io.anuke.mindustry.game.*;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.type.ItemStack;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
@ -66,9 +66,7 @@ public class Logic implements ApplicationListener{
|
||||
for(Team team : Team.all){
|
||||
if(state.teams.isActive(team)){
|
||||
for(Tile core : state.teams.get(team).cores){
|
||||
for(ItemStack stack : state.rules.startingItems){
|
||||
core.entity.items.add(stack.item, stack.amount);
|
||||
}
|
||||
core.entity.items.add(Items.copper, 200);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -183,8 +183,7 @@ public class MapView extends Element implements GestureListener{
|
||||
public void act(float delta){
|
||||
super.act(delta);
|
||||
|
||||
if(Core.scene.getKeyboardFocus() == null || !(Core.scene.getKeyboardFocus() instanceof TextField) &&
|
||||
!Core.input.keyDown(KeyCode.CONTROL_LEFT)){
|
||||
if(Core.scene.getKeyboardFocus() == null || !(Core.scene.getKeyboardFocus() instanceof TextField) && !Core.input.keyDown(KeyCode.CONTROL_LEFT)){
|
||||
float ax = Core.input.axis(Binding.move_x);
|
||||
float ay = Core.input.axis(Binding.move_y);
|
||||
offsetx -= ax * 15f / zoom;
|
||||
|
@ -2,9 +2,7 @@ package io.anuke.mindustry.game;
|
||||
|
||||
import io.anuke.annotations.Annotations.Serialize;
|
||||
import io.anuke.arc.collection.Array;
|
||||
import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.io.JsonIO;
|
||||
import io.anuke.mindustry.type.ItemStack;
|
||||
import io.anuke.mindustry.type.Zone;
|
||||
|
||||
/**
|
||||
@ -65,8 +63,6 @@ public class Rules{
|
||||
public boolean attackMode = false;
|
||||
/** Whether this is the editor gamemode. */
|
||||
public boolean editor = false;
|
||||
/** Items that the player starts with here. Not applicable to zones.*/
|
||||
public Array<ItemStack> startingItems = Array.with(new ItemStack(Items.copper, 200));
|
||||
|
||||
/** Copies this ruleset exactly. Not very efficient at all, do not use often. */
|
||||
public Rules copy(){
|
||||
|
@ -12,7 +12,6 @@ public class JsonIO{
|
||||
private static Json json = new Json(){{
|
||||
setIgnoreUnknownFields(true);
|
||||
setElementType(Rules.class, "spawns", SpawnGroup.class);
|
||||
setElementType(Rules.class, "startingItems", ItemStack.class);
|
||||
|
||||
setSerializer(Zone.class, new Serializer<Zone>(){
|
||||
@Override
|
||||
|
@ -100,19 +100,25 @@ public class CrashSender{
|
||||
ex(() -> value.addChild("os", new JsonValue(System.getProperty("os.name"))));
|
||||
ex(() -> value.addChild("trace", new JsonValue(parseException(exception))));
|
||||
|
||||
boolean[] sent = {false};
|
||||
|
||||
Log.info("Sending crash report.");
|
||||
//post to crash report URL
|
||||
Net.http(Vars.crashReportURL, "POST", value.toJson(OutputType.json), r -> {
|
||||
Log.info("Crash sent successfully.");
|
||||
sent[0] = true;
|
||||
System.exit(1);
|
||||
}, t -> {
|
||||
t.printStackTrace();
|
||||
sent[0] = true;
|
||||
System.exit(1);
|
||||
});
|
||||
|
||||
//sleep for 10 seconds or until crash report is sent
|
||||
//sleep until report is sent
|
||||
try{
|
||||
Thread.sleep(10000);
|
||||
while(!sent[0]){
|
||||
Thread.sleep(30);
|
||||
}
|
||||
}catch(InterruptedException ignored){
|
||||
}
|
||||
}catch(Throwable death){
|
||||
|
@ -72,10 +72,12 @@ public class MechPad extends Block{
|
||||
|
||||
if(entity.player == null) return;
|
||||
Mech mech = ((MechPad)tile.block()).mech;
|
||||
boolean resetSpawner = !entity.sameMech && entity.player.mech == mech;
|
||||
entity.player.mech = !entity.sameMech && entity.player.mech == mech ? Mechs.starter : mech;
|
||||
|
||||
entity.progress = 0;
|
||||
entity.player.onRespawn(tile);
|
||||
if(resetSpawner) entity.player.lastSpawner = null;
|
||||
entity.player = null;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user