mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-11 11:17:11 +07:00
Fixed #500 / Fixed units not appearing in edited maps
This commit is contained in:
parent
4242100c53
commit
c66fd67510
@ -188,13 +188,14 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
});
|
});
|
||||||
|
|
||||||
shown(() -> {
|
shown(() -> {
|
||||||
//clear units, rules and other unnecessary stuff
|
|
||||||
logic.reset();
|
|
||||||
saved = true;
|
saved = true;
|
||||||
if(!Core.settings.getBool("landscape")) Platform.instance.beginForceLandscape();
|
if(!Core.settings.getBool("landscape")) Platform.instance.beginForceLandscape();
|
||||||
editor.clearOp();
|
editor.clearOp();
|
||||||
Core.scene.setScrollFocus(view);
|
Core.scene.setScrollFocus(view);
|
||||||
if(!shownWithMap){
|
if(!shownWithMap){
|
||||||
|
//clear units, rules and other unnecessary stuff
|
||||||
|
logic.reset();
|
||||||
state.rules = new Rules();
|
state.rules = new Rules();
|
||||||
editor.beginEdit(200, 200);
|
editor.beginEdit(200, 200);
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ public interface BuilderTrait extends Entity, TeamTrait{
|
|||||||
output.writeInt(Pos.get(request.x, request.y));
|
output.writeInt(Pos.get(request.x, request.y));
|
||||||
output.writeFloat(request.progress);
|
output.writeFloat(request.progress);
|
||||||
if(!request.breaking){
|
if(!request.breaking){
|
||||||
output.writeByte(request.block.id);
|
output.writeShort(request.block.id);
|
||||||
output.writeByte(request.rotation);
|
output.writeByte(request.rotation);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
@ -189,7 +189,7 @@ public interface BuilderTrait extends Entity, TeamTrait{
|
|||||||
if(type == 1){ //remove
|
if(type == 1){ //remove
|
||||||
request = new BuildRequest(Pos.x(position), Pos.y(position));
|
request = new BuildRequest(Pos.x(position), Pos.y(position));
|
||||||
}else{ //place
|
}else{ //place
|
||||||
byte block = input.readByte();
|
short block = input.readShort();
|
||||||
byte rotation = input.readByte();
|
byte rotation = input.readByte();
|
||||||
request = new BuildRequest(Pos.x(position), Pos.y(position), rotation, content.block(block));
|
request = new BuildRequest(Pos.x(position), Pos.y(position), rotation, content.block(block));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user