mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-12 19:09:34 +07:00
Fixed #10163
This commit is contained in:
parent
5f164b6270
commit
46cc0d4cc1
@ -457,7 +457,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
cursorType = cursor.build.getCursor();
|
cursorType = cursor.build.getCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(cursor.build != null && player.team() != Team.derelict && cursor.build.team == Team.derelict && Build.validPlace(cursor.block(), player.team(), cursor.build.tileX(), cursor.build.tileY(), cursor.build.rotation)){
|
if(cursor.build != null && player.team() != Team.derelict && cursor.build.team == Team.derelict && cursor.build.block.unlockedNow() && Build.validPlace(cursor.block(), player.team(), cursor.build.tileX(), cursor.build.tileY(), cursor.build.rotation)){
|
||||||
cursorType = ui.repairCursor;
|
cursorType = ui.repairCursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -380,13 +380,20 @@ public class Conveyor extends Block implements Autotiler{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public byte version(){
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(Writes write){
|
public void write(Writes write){
|
||||||
super.write(write);
|
super.write(write);
|
||||||
write.i(len);
|
write.i(len);
|
||||||
|
|
||||||
for(int i = 0; i < len; i++){
|
for(int i = 0; i < len; i++){
|
||||||
write.i(Pack.intBytes((byte)ids[i].id, (byte)(xs[i] * 127), (byte)(ys[i] * 255 - 128), (byte)0));
|
write.s(ids[i].id);
|
||||||
|
write.b((byte)(xs[i] * 127));
|
||||||
|
write.b((byte)(ys[i] * 255 - 128));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -397,10 +404,20 @@ public class Conveyor extends Block implements Autotiler{
|
|||||||
len = Math.min(amount, capacity);
|
len = Math.min(amount, capacity);
|
||||||
|
|
||||||
for(int i = 0; i < amount; i++){
|
for(int i = 0; i < amount; i++){
|
||||||
|
short id;
|
||||||
|
float x, y;
|
||||||
|
|
||||||
|
if(revision == 0){
|
||||||
int val = read.i();
|
int val = read.i();
|
||||||
short id = (short)(((byte)(val >> 24)) & 0xff);
|
id = (short)(((byte)(val >> 24)) & 0xff);
|
||||||
float x = (float)((byte)(val >> 16)) / 127f;
|
x = (float)((byte)(val >> 16)) / 127f;
|
||||||
float y = ((float)((byte)(val >> 8)) + 128f) / 255f;
|
y = ((float)((byte)(val >> 8)) + 128f) / 255f;
|
||||||
|
}else{
|
||||||
|
id = read.s();
|
||||||
|
x = (float)read.b() / 127f;
|
||||||
|
y = ((float)read.b() + 128f) / 255f;
|
||||||
|
}
|
||||||
|
|
||||||
if(i < capacity){
|
if(i < capacity){
|
||||||
ids[i] = content.item(id);
|
ids[i] = content.item(id);
|
||||||
xs[i] = x;
|
xs[i] = x;
|
||||||
|
Loading…
Reference in New Issue
Block a user