Fixed crashes with team IDs above 127
This commit is contained in:
@@ -52,7 +52,7 @@ public class DrawOperation{
|
||||
}else if(type == OpType.rotation.ordinal()){
|
||||
return tile.rotation();
|
||||
}else if(type == OpType.team.ordinal()){
|
||||
return tile.getTeamID();
|
||||
return (byte)tile.getTeamID();
|
||||
}else if(type == OpType.overlay.ordinal()){
|
||||
return tile.overlayID();
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class EditorTile extends Tile{
|
||||
|
||||
op(OpType.block, block.id);
|
||||
if(rotation != 0) op(OpType.rotation, (byte)rotation);
|
||||
if(team() != Team.derelict) op(OpType.team, team().id);
|
||||
if(team() != Team.derelict) op(OpType.team, (byte)team().id);
|
||||
super.setBlock(type, team, rotation);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class EditorTile extends Tile{
|
||||
}
|
||||
|
||||
if(getTeamID() == team.id) return;
|
||||
op(OpType.team, getTeamID());
|
||||
op(OpType.team, (byte)getTeamID());
|
||||
super.setTeam(team);
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ public enum EditorTool{
|
||||
if(tile.synthetic()){
|
||||
Team dest = tile.team();
|
||||
if(dest == editor.drawTeam) return;
|
||||
fill(editor, x, y, false, t -> t.getTeamID() == (int)dest.id && t.synthetic(), t -> t.setTeam(editor.drawTeam));
|
||||
fill(editor, x, y, false, t -> t.getTeamID() == dest.id && t.synthetic(), t -> t.setTeam(editor.drawTeam));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -409,7 +409,7 @@ public class MapGenerateDialog extends BaseDialog{
|
||||
this.floor = floor.id;
|
||||
this.block = wall.id;
|
||||
this.ore = ore.id;
|
||||
this.team = team.id;
|
||||
this.team = (byte)team.id;
|
||||
this.rotation = (byte)rotation;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user