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)"
|
"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);
|
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())) {
|
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)) {
|
}else if(isPrimitive(typeName)) {
|
||||||
if(simpleTypeName.equals("boolean")){
|
if(simpleTypeName.equals("boolean")){
|
||||||
writeSwitch.addStatement("boolean " + varName + " = " + bufferName + ".get() == 1");
|
writeSwitch.addStatement("boolean " + varName + " = " + writeBufferName + ".get() == 1");
|
||||||
}else{
|
}else{
|
||||||
writeSwitch.addStatement(typeName + " " + varName + " = " + bufferName + ".get" + capName + "()");
|
writeSwitch.addStatement(typeName + " " + varName + " = " + writeBufferName + ".get" + capName + "()");
|
||||||
}
|
}
|
||||||
}else if(writeMap.get(simpleTypeName) != null){
|
}else if(writeMap.get(simpleTypeName) != null){
|
||||||
String[] values = writeMap.get(simpleTypeName)[1];
|
String[] values = writeMap.get(simpleTypeName)[1];
|
||||||
for(String str : values){
|
for(String str : values){
|
||||||
writeSwitch.addStatement(str.replaceAll("rbuffer", bufferName)
|
writeSwitch.addStatement(str.replaceAll("rbuffer", writeBufferName)
|
||||||
.replaceAll("rvalue", varName)
|
.replaceAll("rvalue", varName)
|
||||||
.replaceAll("rtype", simpleTypeName));
|
.replaceAll("rtype", simpleTypeName));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import io.anuke.mindustry.content.Weapons;
|
|||||||
import io.anuke.mindustry.content.fx.ExplosionFx;
|
import io.anuke.mindustry.content.fx.ExplosionFx;
|
||||||
import io.anuke.mindustry.entities.effect.DamageArea;
|
import io.anuke.mindustry.entities.effect.DamageArea;
|
||||||
import io.anuke.mindustry.game.Team;
|
import io.anuke.mindustry.game.Team;
|
||||||
import io.anuke.mindustry.gen.CallClient;
|
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.mindustry.net.NetEvents;
|
import io.anuke.mindustry.net.NetEvents;
|
||||||
@@ -307,6 +306,7 @@ public class Player extends Unit implements BlockPlacer{
|
|||||||
respawntime = -1;
|
respawntime = -1;
|
||||||
inventory.clear();
|
inventory.clear();
|
||||||
upgrades.clear();
|
upgrades.clear();
|
||||||
|
placeQueue.clear();
|
||||||
|
|
||||||
add();
|
add();
|
||||||
heal();
|
heal();
|
||||||
|
|||||||
@@ -114,11 +114,10 @@ public enum PlaceMode{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
areaDelete{
|
areaDelete{
|
||||||
int maxlen = debug ? 999999: 20;
|
int rtilex;
|
||||||
int tilex;
|
int rtiley;
|
||||||
int tiley;
|
int rendx;
|
||||||
int endx;
|
int rendy;
|
||||||
int endy;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
shown = true;
|
shown = true;
|
||||||
@@ -131,10 +130,10 @@ public enum PlaceMode{
|
|||||||
|
|
||||||
process(tilex, tiley, endx, endy);
|
process(tilex, tiley, endx, endy);
|
||||||
|
|
||||||
tilex = this.tilex; tiley = this.tiley;
|
tilex = this.rtilex; tiley = this.rtiley;
|
||||||
endx = this.endx; endy = this.endy;
|
endx = this.rendx; endy = this.rendy;
|
||||||
float x = this.tilex * t, y = this.tiley * t,
|
float x = this.rtilex * t, y = this.rtiley * t,
|
||||||
x2 = this.endx * t, y2 = this.endy * t;
|
x2 = this.rendx * t, y2 = this.rendy * t;
|
||||||
|
|
||||||
if(x2 >= x){
|
if(x2 >= x){
|
||||||
x -= t/2;
|
x -= t/2;
|
||||||
@@ -170,8 +169,10 @@ public enum PlaceMode{
|
|||||||
|
|
||||||
public void released(InputHandler input, int tilex, int tiley, int endx, int endy){
|
public void released(InputHandler input, int tilex, int tiley, int endx, int endy){
|
||||||
process(tilex, tiley, endx, endy);
|
process(tilex, tiley, endx, endy);
|
||||||
tilex = this.tilex; tiley = this.tiley;
|
tilex = this.rtilex; tiley = this.rtiley;
|
||||||
endx = this.endx; endy = this.endy;
|
endx = this.rendx; endy = this.rendy;
|
||||||
|
|
||||||
|
input.player.getPlaceQueue().clear();
|
||||||
|
|
||||||
if(mobile){
|
if(mobile){
|
||||||
ToolFragment t = input.frag.tool;
|
ToolFragment t = input.frag.tool;
|
||||||
@@ -197,14 +198,14 @@ public enum PlaceMode{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void process(int tilex, int tiley, int endx, int endy){
|
void process(int tilex, int tiley, int endx, int endy){
|
||||||
|
/*
|
||||||
if(Math.abs(endx - tilex) > maxlen){
|
if(Math.abs(endx - tilex) > maxlen){
|
||||||
endx = Mathf.sign(endx - tilex) * maxlen + tilex;
|
endx = Mathf.sign(endx - tilex) * maxlen + tilex;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Math.abs(endy - tiley) > maxlen){
|
if(Math.abs(endy - tiley) > maxlen){
|
||||||
endy = Mathf.sign(endy - tiley) * maxlen + tiley;
|
endy = Mathf.sign(endy - tiley) * maxlen + tiley;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if(endx < tilex){
|
if(endx < tilex){
|
||||||
int t = endx;
|
int t = endx;
|
||||||
@@ -217,10 +218,10 @@ public enum PlaceMode{
|
|||||||
tiley = t;
|
tiley = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.endx = endx;
|
this.rendx = endx;
|
||||||
this.endy = endy;
|
this.rendy = endy;
|
||||||
this.tilex = tilex;
|
this.rtilex = tilex;
|
||||||
this.tiley = tiley;
|
this.rtiley = tiley;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hold{
|
hold{
|
||||||
@@ -314,6 +315,7 @@ public enum PlaceMode{
|
|||||||
process(input, tilex, tiley, endx, endy);
|
process(input, tilex, tiley, endx, endy);
|
||||||
|
|
||||||
input.rotation = this.rotation;
|
input.rotation = this.rotation;
|
||||||
|
input.player.getPlaceQueue().clear();
|
||||||
|
|
||||||
boolean first = true;
|
boolean first = true;
|
||||||
for(int x = 0; x <= Math.abs(this.rendx - this.rtilex); x += input.recipe.result.size){
|
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
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
|
||||||
|
|||||||
Reference in New Issue
Block a user