This commit is contained in:
Anuken 2024-05-27 09:40:52 -04:00
parent f1f17965bc
commit 6243ef6d4a
5 changed files with 18 additions and 14 deletions

View File

@ -16,7 +16,7 @@ public class EntityCollisions{
//tile collisions
private Vec2 vector = new Vec2(), l1 = new Vec2();
private Rect r1 = new Rect(), r2 = new Rect(), r3 = new Rect(), r4 = new Rect(), tmp = new Rect();
private Rect r1 = new Rect(), r2 = new Rect(), tmp = new Rect();
//entity collisions
private Seq<Hitboxc> arrOut = new Seq<>(Hitboxc.class);
@ -218,12 +218,12 @@ public class EntityCollisions{
}
private void updateCollision(Hitboxc solid){
solid.hitbox(r3);
r3.x += (solid.lastX() - solid.getX());
r3.y += (solid.lastY() - solid.getY());
solid.hitbox(r1);
r1.x += (solid.lastX() - solid.getX());
r1.y += (solid.lastY() - solid.getY());
solid.hitbox(r4);
r4.merge(r3);
solid.hitbox(r2);
r2.merge(r1);
arrOut.clear();
@ -235,8 +235,8 @@ public class EntityCollisions{
for(int i = 0; i < size; i++){
Hitboxc sc = items[i];
sc.hitbox(r3);
if(r4.overlaps(r3)){
sc.hitbox(r1);
if(r2.overlaps(r1)){
checkCollide(solid, sc);
//break out of loop when this object hits something
if(!solid.isAdded()) return;
@ -247,4 +247,4 @@ public class EntityCollisions{
public interface SolidPred{
boolean solid(int x, int y);
}
}
}

View File

@ -628,7 +628,7 @@ public class TypeIO{
}
public static KickReason readKick(Reads read){
return KickReason.values()[read.b()];
return KickReason.all[read.b()];
}
public static void writeMarkerControl(Writes write, LMarkerControl reason){
@ -786,7 +786,7 @@ public class TypeIO{
}
public static AdminAction readAction(Reads read){
return AdminAction.values()[read.b()];
return AdminAction.all[read.b()];
}
public static void writeUnitType(Writes write, UnitType effect){

View File

@ -17,6 +17,8 @@ public class Packets{
nameInUse, idInUse, nameEmpty, customClient, serverClose, vote, typeMismatch,
whitelist, playerLimit, serverRestarting;
public static final KickReason[] all = values();
public final boolean quiet;
KickReason(){
@ -38,7 +40,9 @@ public class Packets{
}
public enum AdminAction{
kick, ban, trace, wave, switchTeam
kick, ban, trace, wave, switchTeam;
public static final AdminAction[] all = values();
}
/** Generic client connection event. */

View File

@ -102,7 +102,7 @@ public class MapPlayDialog extends BaseDialog{
ScrollPane pane = new ScrollPane(table);
pane.setFadeScrollBars(false);
table.row();
for(Gamemode mode : Gamemode.values()){
for(Gamemode mode : Gamemode.all){
if(mode.hidden) continue;
table.labelWrap("[accent]" + mode + ":[] [lightgray]" + mode.description()).width(400f);
table.row();

View File

@ -25,4 +25,4 @@ org.gradle.caching=true
#used for slow jitpack builds; TODO see if this actually works
org.gradle.internal.http.socketTimeout=100000
org.gradle.internal.http.connectionTimeout=100000
archash=f0d4fdbf89
archash=eac3d7211c