Fixed place mode not overwriting old queue
This commit is contained in:
Binary file not shown.
@@ -36,7 +36,7 @@ public class AnnotationProcessor extends AbstractProcessor {
|
||||
"rbuffer.putInt(rvalue.id)"
|
||||
},
|
||||
{
|
||||
"rtype rvalue = io.anuke.mindustry.Vars.playerGroup.getByID(buffer.getInt())"
|
||||
"rtype rvalue = io.anuke.mindustry.Vars.playerGroup.getByID(rbuffer.getInt())"
|
||||
}
|
||||
});
|
||||
}};
|
||||
@@ -189,18 +189,20 @@ public class AnnotationProcessor extends AbstractProcessor {
|
||||
messager.printMessage(Kind.ERROR, "No method for writing type: " + typeName, var);
|
||||
}
|
||||
|
||||
String writeBufferName = "buffer";
|
||||
|
||||
if(typeUtils.isAssignable(var.asType(), elementUtils.getTypeElement("java.lang.Enum").asType())) {
|
||||
writeSwitch.addStatement(typeName + " " + varName + " = " + typeName + ".values()["+bufferName +".getInt()]");
|
||||
writeSwitch.addStatement(typeName + " " + varName + " = " + typeName + ".values()["+writeBufferName +".getInt()]");
|
||||
}else if(isPrimitive(typeName)) {
|
||||
if(simpleTypeName.equals("boolean")){
|
||||
writeSwitch.addStatement("boolean " + varName + " = " + bufferName + ".get() == 1");
|
||||
writeSwitch.addStatement("boolean " + varName + " = " + writeBufferName + ".get() == 1");
|
||||
}else{
|
||||
writeSwitch.addStatement(typeName + " " + varName + " = " + bufferName + ".get" + capName + "()");
|
||||
writeSwitch.addStatement(typeName + " " + varName + " = " + writeBufferName + ".get" + capName + "()");
|
||||
}
|
||||
}else if(writeMap.get(simpleTypeName) != null){
|
||||
String[] values = writeMap.get(simpleTypeName)[1];
|
||||
for(String str : values){
|
||||
writeSwitch.addStatement(str.replaceAll("rbuffer", bufferName)
|
||||
writeSwitch.addStatement(str.replaceAll("rbuffer", writeBufferName)
|
||||
.replaceAll("rvalue", varName)
|
||||
.replaceAll("rtype", simpleTypeName));
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import io.anuke.mindustry.content.Weapons;
|
||||
import io.anuke.mindustry.content.fx.ExplosionFx;
|
||||
import io.anuke.mindustry.entities.effect.DamageArea;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.gen.CallClient;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.net.NetEvents;
|
||||
@@ -307,6 +306,7 @@ public class Player extends Unit implements BlockPlacer{
|
||||
respawntime = -1;
|
||||
inventory.clear();
|
||||
upgrades.clear();
|
||||
placeQueue.clear();
|
||||
|
||||
add();
|
||||
heal();
|
||||
|
||||
@@ -114,11 +114,10 @@ public enum PlaceMode{
|
||||
}
|
||||
},
|
||||
areaDelete{
|
||||
int maxlen = debug ? 999999: 20;
|
||||
int tilex;
|
||||
int tiley;
|
||||
int endx;
|
||||
int endy;
|
||||
int rtilex;
|
||||
int rtiley;
|
||||
int rendx;
|
||||
int rendy;
|
||||
|
||||
{
|
||||
shown = true;
|
||||
@@ -131,10 +130,10 @@ public enum PlaceMode{
|
||||
|
||||
process(tilex, tiley, endx, endy);
|
||||
|
||||
tilex = this.tilex; tiley = this.tiley;
|
||||
endx = this.endx; endy = this.endy;
|
||||
float x = this.tilex * t, y = this.tiley * t,
|
||||
x2 = this.endx * t, y2 = this.endy * t;
|
||||
tilex = this.rtilex; tiley = this.rtiley;
|
||||
endx = this.rendx; endy = this.rendy;
|
||||
float x = this.rtilex * t, y = this.rtiley * t,
|
||||
x2 = this.rendx * t, y2 = this.rendy * t;
|
||||
|
||||
if(x2 >= x){
|
||||
x -= t/2;
|
||||
@@ -170,8 +169,10 @@ public enum PlaceMode{
|
||||
|
||||
public void released(InputHandler input, int tilex, int tiley, int endx, int endy){
|
||||
process(tilex, tiley, endx, endy);
|
||||
tilex = this.tilex; tiley = this.tiley;
|
||||
endx = this.endx; endy = this.endy;
|
||||
tilex = this.rtilex; tiley = this.rtiley;
|
||||
endx = this.rendx; endy = this.rendy;
|
||||
|
||||
input.player.getPlaceQueue().clear();
|
||||
|
||||
if(mobile){
|
||||
ToolFragment t = input.frag.tool;
|
||||
@@ -197,14 +198,14 @@ public enum PlaceMode{
|
||||
}
|
||||
|
||||
void process(int tilex, int tiley, int endx, int endy){
|
||||
|
||||
/*
|
||||
if(Math.abs(endx - tilex) > maxlen){
|
||||
endx = Mathf.sign(endx - tilex) * maxlen + tilex;
|
||||
}
|
||||
|
||||
if(Math.abs(endy - tiley) > maxlen){
|
||||
endy = Mathf.sign(endy - tiley) * maxlen + tiley;
|
||||
}
|
||||
}*/
|
||||
|
||||
if(endx < tilex){
|
||||
int t = endx;
|
||||
@@ -217,10 +218,10 @@ public enum PlaceMode{
|
||||
tiley = t;
|
||||
}
|
||||
|
||||
this.endx = endx;
|
||||
this.endy = endy;
|
||||
this.tilex = tilex;
|
||||
this.tiley = tiley;
|
||||
this.rendx = endx;
|
||||
this.rendy = endy;
|
||||
this.rtilex = tilex;
|
||||
this.rtiley = tiley;
|
||||
}
|
||||
},
|
||||
hold{
|
||||
@@ -314,6 +315,7 @@ public enum PlaceMode{
|
||||
process(input, tilex, tiley, endx, endy);
|
||||
|
||||
input.rotation = this.rotation;
|
||||
input.player.getPlaceQueue().clear();
|
||||
|
||||
boolean first = true;
|
||||
for(int x = 0; x <= Math.abs(this.rendx - this.rtilex); x += input.recipe.result.size){
|
||||
|
||||
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,6 @@
|
||||
#Sun May 20 12:43:04 EDT 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
|
||||
|
||||
Reference in New Issue
Block a user