Bugfixes
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package mindustry.ai.types;
|
package mindustry.ai.types;
|
||||||
|
|
||||||
|
import arc.math.*;
|
||||||
import mindustry.ai.Pathfinder.*;
|
import mindustry.ai.Pathfinder.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
import mindustry.entities.units.*;
|
import mindustry.entities.units.*;
|
||||||
@@ -28,6 +29,10 @@ public class GroundAI extends AIController{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(unit.type().canBoost){
|
||||||
|
unit.elevation = Mathf.approachDelta(unit.elevation, 0f, 0.08f);
|
||||||
|
}
|
||||||
|
|
||||||
if(!Units.invalidateTarget(target, unit, unit.range())){
|
if(!Units.invalidateTarget(target, unit, unit.range())){
|
||||||
if(unit.type().hasWeapons()){
|
if(unit.type().hasWeapons()){
|
||||||
unit.aimLook(Predict.intercept(unit, target, unit.type().weapons.first().bullet.speed));
|
unit.aimLook(Predict.intercept(unit, target, unit.type().weapons.first().bullet.speed));
|
||||||
|
|||||||
@@ -559,6 +559,22 @@ public class NetClient implements ApplicationListener{
|
|||||||
//limit to 10 to prevent buffer overflows
|
//limit to 10 to prevent buffer overflows
|
||||||
int usedRequests = Math.min(player.builder().plans().size, 10);
|
int usedRequests = Math.min(player.builder().plans().size, 10);
|
||||||
|
|
||||||
|
int totalLength = 0;
|
||||||
|
|
||||||
|
//prevent buffer overflow by checking config length
|
||||||
|
for(int i = 0; i < usedRequests; i++){
|
||||||
|
BuildPlan plan = player.builder().plans().get(i);
|
||||||
|
if(plan.config instanceof byte[]){
|
||||||
|
int length = ((byte[])plan.config).length;
|
||||||
|
totalLength += length;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(totalLength > 2048){
|
||||||
|
usedRequests = i + 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
requests = new BuildPlan[usedRequests];
|
requests = new BuildPlan[usedRequests];
|
||||||
for(int i = 0; i < usedRequests; i++){
|
for(int i = 0; i < usedRequests; i++){
|
||||||
requests[i] = player.builder().plans().get(i);
|
requests[i] = player.builder().plans().get(i);
|
||||||
|
|||||||
@@ -614,7 +614,7 @@ public class NetServer implements ApplicationListener{
|
|||||||
Unit unit = player.unit();
|
Unit unit = player.unit();
|
||||||
|
|
||||||
long elapsed = Time.timeSinceMillis(con.lastReceivedClientTime);
|
long elapsed = Time.timeSinceMillis(con.lastReceivedClientTime);
|
||||||
float maxSpeed = (boosting ? player.unit().type().boostMultiplier : 1f) * player.unit().type().speed;
|
float maxSpeed = ((player.unit().type().canBoost && player.unit().isFlying()) ? player.unit().type().boostMultiplier : 1f) * player.unit().type().speed;
|
||||||
if(unit.isGrounded()){
|
if(unit.isGrounded()){
|
||||||
maxSpeed *= unit.floorSpeedMultiplier();
|
maxSpeed *= unit.floorSpeedMultiplier();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,9 +75,13 @@ public class Administration{
|
|||||||
addActionFilter(action -> {
|
addActionFilter(action -> {
|
||||||
if(action.type != ActionType.breakBlock &&
|
if(action.type != ActionType.breakBlock &&
|
||||||
action.type != ActionType.placeBlock &&
|
action.type != ActionType.placeBlock &&
|
||||||
Config.antiSpam.bool() &&
|
Config.antiSpam.bool()){
|
||||||
//make sure players can configure their own stuff, e.g. in schematics
|
|
||||||
lastPlaced.get(action.tile.pos(), -1) != action.player.id()){
|
//make sure players can configure their own stuff, e.g. in schematics - but only once.
|
||||||
|
if(lastPlaced.get(action.tile.pos(), -1) == action.player.id()){
|
||||||
|
lastPlaced.remove(action.tile.pos());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
Ratekeeper rate = action.player.getInfo().rate;
|
Ratekeeper rate = action.player.getInfo().rate;
|
||||||
if(rate.allow(Config.interactRateWindow.num() * 1000, Config.interactRateLimit.num())){
|
if(rate.allow(Config.interactRateWindow.num() * 1000, Config.interactRateLimit.num())){
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ public class ResearchDialog extends BaseDialog{
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean selectable(TechNode node){
|
boolean selectable(TechNode node){
|
||||||
return !node.objectives.contains(i -> !i.complete());
|
return node.content.unlocked() || !node.objectives.contains(i -> !i.complete());
|
||||||
}
|
}
|
||||||
|
|
||||||
void showToast(String info){
|
void showToast(String info){
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=1040fdcbb5760e4c4a646d64782a25761efc1159
|
archash=b06edb6b57c0e6247c1856c507a33fb8b64656e7
|
||||||
|
|||||||
Reference in New Issue
Block a user