Fixed #500 / Fixed units not appearing in edited maps

This commit is contained in:
Anuken 2019-05-25 21:10:42 -04:00
parent 4242100c53
commit c66fd67510
2 changed files with 5 additions and 4 deletions

View File

@ -188,13 +188,14 @@ public class MapEditorDialog extends Dialog implements Disposable{
});
shown(() -> {
//clear units, rules and other unnecessary stuff
logic.reset();
saved = true;
if(!Core.settings.getBool("landscape")) Platform.instance.beginForceLandscape();
editor.clearOp();
Core.scene.setScrollFocus(view);
if(!shownWithMap){
//clear units, rules and other unnecessary stuff
logic.reset();
state.rules = new Rules();
editor.beginEdit(200, 200);
}

View File

@ -165,7 +165,7 @@ public interface BuilderTrait extends Entity, TeamTrait{
output.writeInt(Pos.get(request.x, request.y));
output.writeFloat(request.progress);
if(!request.breaking){
output.writeByte(request.block.id);
output.writeShort(request.block.id);
output.writeByte(request.rotation);
}
}else{
@ -189,7 +189,7 @@ public interface BuilderTrait extends Entity, TeamTrait{
if(type == 1){ //remove
request = new BuildRequest(Pos.x(position), Pos.y(position));
}else{ //place
byte block = input.readByte();
short block = input.readShort();
byte rotation = input.readByte();
request = new BuildRequest(Pos.x(position), Pos.y(position), rotation, content.block(block));
}