Fixed #2565
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 811 B After Width: | Height: | Size: 810 B |
Binary file not shown.
|
Before Width: | Height: | Size: 188 KiB After Width: | Height: | Size: 187 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 189 KiB After Width: | Height: | Size: 188 KiB |
@@ -1,7 +1,6 @@
|
|||||||
package mindustry.ai.types;
|
package mindustry.ai.types;
|
||||||
|
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.util.*;
|
|
||||||
import mindustry.entities.units.*;
|
import mindustry.entities.units.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.world.meta.*;
|
import mindustry.world.meta.*;
|
||||||
@@ -59,7 +58,7 @@ public class FlyingAI extends AIController{
|
|||||||
vec.setAngle(Mathf.slerpDelta(unit.vel().angle(), vec.angle(), 0.6f));
|
vec.setAngle(Mathf.slerpDelta(unit.vel().angle(), vec.angle(), 0.6f));
|
||||||
}
|
}
|
||||||
|
|
||||||
vec.setLength(unit.type().speed * Time.delta);
|
vec.setLength(unit.type().speed);
|
||||||
|
|
||||||
unit.moveAt(vec);
|
unit.moveAt(vec);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ public class EditorTile extends Tile{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
op(OpType.block, block.id);
|
|
||||||
if(rotation != 0) op(OpType.rotation, (byte)rotation);
|
if(rotation != 0) op(OpType.rotation, (byte)rotation);
|
||||||
if(team() != Team.derelict) op(OpType.team, (byte)team().id);
|
if(team() != Team.derelict) op(OpType.team, (byte)team().id);
|
||||||
|
op(OpType.block, block.id);
|
||||||
super.setBlock(type, team, rotation);
|
super.setBlock(type, team, rotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ public class AIController implements UnitController{
|
|||||||
vec.rotate((circleLength - vec.len()) / circleLength * 180f);
|
vec.rotate((circleLength - vec.len()) / circleLength * 180f);
|
||||||
}
|
}
|
||||||
|
|
||||||
vec.setLength(speed * Time.delta);
|
vec.setLength(speed);
|
||||||
|
|
||||||
unit.moveAt(vec);
|
unit.moveAt(vec);
|
||||||
}
|
}
|
||||||
@@ -164,7 +164,7 @@ public class AIController implements UnitController{
|
|||||||
|
|
||||||
float length = circleLength <= 0.001f ? 1f : Mathf.clamp((unit.dst(target) - circleLength) / 100f, -1f, 1f);
|
float length = circleLength <= 0.001f ? 1f : Mathf.clamp((unit.dst(target) - circleLength) / 100f, -1f, 1f);
|
||||||
|
|
||||||
vec.setLength(unit.type().speed * Time.delta * length);
|
vec.setLength(unit.type().speed * length);
|
||||||
if(length < -0.5f){
|
if(length < -0.5f){
|
||||||
vec.rotate(180f);
|
vec.rotate(180f);
|
||||||
}else if(length < 0){
|
}else if(length < 0){
|
||||||
|
|||||||
@@ -96,24 +96,24 @@ public class IndexedRenderer implements Disposable{
|
|||||||
vertices[idx++] = v2;
|
vertices[idx++] = v2;
|
||||||
|
|
||||||
//tri2
|
//tri2
|
||||||
vertices[idx++] = x;
|
|
||||||
vertices[idx++] = y;
|
|
||||||
vertices[idx++] = color;
|
|
||||||
vertices[idx++] = u;
|
|
||||||
vertices[idx++] = v;
|
|
||||||
|
|
||||||
vertices[idx++] = fx2;
|
|
||||||
vertices[idx++] = y;
|
|
||||||
vertices[idx++] = color;
|
|
||||||
vertices[idx++] = u2;
|
|
||||||
vertices[idx++] = v;
|
|
||||||
|
|
||||||
vertices[idx++] = fx2;
|
vertices[idx++] = fx2;
|
||||||
vertices[idx++] = fy2;
|
vertices[idx++] = fy2;
|
||||||
vertices[idx++] = color;
|
vertices[idx++] = color;
|
||||||
vertices[idx++] = u2;
|
vertices[idx++] = u2;
|
||||||
vertices[idx++] = v2;
|
vertices[idx++] = v2;
|
||||||
|
|
||||||
|
vertices[idx++] = fx2;
|
||||||
|
vertices[idx++] = y;
|
||||||
|
vertices[idx++] = color;
|
||||||
|
vertices[idx++] = u2;
|
||||||
|
vertices[idx++] = v;
|
||||||
|
|
||||||
|
vertices[idx++] = x;
|
||||||
|
vertices[idx++] = y;
|
||||||
|
vertices[idx++] = color;
|
||||||
|
vertices[idx++] = u;
|
||||||
|
vertices[idx++] = v;
|
||||||
|
|
||||||
mesh.updateVertices(index * vsize * 6, vertices);
|
mesh.updateVertices(index * vsize * 6, vertices);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,6 +155,19 @@ public class IndexedRenderer implements Disposable{
|
|||||||
vertices[idx++] = u;
|
vertices[idx++] = u;
|
||||||
vertices[idx++] = v;
|
vertices[idx++] = v;
|
||||||
|
|
||||||
|
vertices[idx++] = x2;
|
||||||
|
vertices[idx++] = y2;
|
||||||
|
vertices[idx++] = color;
|
||||||
|
vertices[idx++] = u;
|
||||||
|
vertices[idx++] = v2;
|
||||||
|
|
||||||
|
vertices[idx++] = x3;
|
||||||
|
vertices[idx++] = y3;
|
||||||
|
vertices[idx++] = color;
|
||||||
|
vertices[idx++] = u2;
|
||||||
|
vertices[idx++] = v2;
|
||||||
|
|
||||||
|
//tri2
|
||||||
vertices[idx++] = x3;
|
vertices[idx++] = x3;
|
||||||
vertices[idx++] = y3;
|
vertices[idx++] = y3;
|
||||||
vertices[idx++] = color;
|
vertices[idx++] = color;
|
||||||
@@ -164,28 +177,15 @@ public class IndexedRenderer implements Disposable{
|
|||||||
vertices[idx++] = x4;
|
vertices[idx++] = x4;
|
||||||
vertices[idx++] = y4;
|
vertices[idx++] = y4;
|
||||||
vertices[idx++] = color;
|
vertices[idx++] = color;
|
||||||
vertices[idx++] = u;
|
vertices[idx++] = u2;
|
||||||
vertices[idx++] = v2;
|
vertices[idx++] = v;
|
||||||
|
|
||||||
//tri2
|
|
||||||
vertices[idx++] = x1;
|
vertices[idx++] = x1;
|
||||||
vertices[idx++] = y1;
|
vertices[idx++] = y1;
|
||||||
vertices[idx++] = color;
|
vertices[idx++] = color;
|
||||||
vertices[idx++] = u;
|
vertices[idx++] = u;
|
||||||
vertices[idx++] = v;
|
vertices[idx++] = v;
|
||||||
|
|
||||||
vertices[idx++] = x2;
|
|
||||||
vertices[idx++] = y2;
|
|
||||||
vertices[idx++] = color;
|
|
||||||
vertices[idx++] = u2;
|
|
||||||
vertices[idx++] = v;
|
|
||||||
|
|
||||||
vertices[idx++] = x3;
|
|
||||||
vertices[idx++] = y3;
|
|
||||||
vertices[idx++] = color;
|
|
||||||
vertices[idx++] = u2;
|
|
||||||
vertices[idx++] = v2;
|
|
||||||
|
|
||||||
mesh.updateVertices(index * vsize * 6, vertices);
|
mesh.updateVertices(index * vsize * 6, vertices);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -600,9 +600,14 @@ public class Mods implements Loadable{
|
|||||||
zip = zip.list()[0];
|
zip = zip.list()[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
Fi metaf = zip.child("mod.json").exists() ? zip.child("mod.json") : zip.child("mod.hjson").exists() ? zip.child("mod.hjson") : zip.child("plugin.json");
|
Fi metaf =
|
||||||
|
zip.child("mod.json").exists() ? zip.child("mod.json") :
|
||||||
|
zip.child("mod.hjson").exists() ? zip.child("mod.hjson") :
|
||||||
|
zip.child("plugin.json").exists() ? zip.child("plugin.json") :
|
||||||
|
zip.child("plugin.hjson");
|
||||||
|
|
||||||
if(!metaf.exists()){
|
if(!metaf.exists()){
|
||||||
Log.warn("Mod @ doesn't have a 'mod.json'/'mod.hjson'/'plugin.json' file, skipping.", sourceFile);
|
Log.warn("Mod @ doesn't have a '[mod/plugin].[h]json' file, skipping.", sourceFile);
|
||||||
throw new IllegalArgumentException("Invalid file: No mod.json found.");
|
throw new IllegalArgumentException("Invalid file: No mod.json found.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -646,7 +651,9 @@ public class Mods implements Loadable{
|
|||||||
meta.hidden = true;
|
meta.hidden = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.info("Loaded mod '@' in @", meta.name, Time.elapsed());
|
if(!headless){
|
||||||
|
Log.info("Loaded mod '@' in @ms", meta.name, Time.elapsed());
|
||||||
|
}
|
||||||
return new LoadedMod(sourceFile, zip, mainMod, meta);
|
return new LoadedMod(sourceFile, zip, mainMod, meta);
|
||||||
|
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
|
|||||||
Reference in New Issue
Block a user