make sure maps get copied over upon transition. Only one instance of map needed.
Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
3f92046a1f
commit
17de1993ca
@ -50,13 +50,17 @@ public class Map {
|
||||
try {
|
||||
if (RabiClone.CURRENT_MAP!=null) {
|
||||
if (RabiClone.CURRENT_MAP!=map) {
|
||||
resetMapData(RabiClone.CURRENT_MAP.getMap());
|
||||
Map currentMapData = RabiClone.CURRENT_MAP.getMap();
|
||||
resetMapData(currentMapData);
|
||||
RabiClone.CURRENT_MAP=map;
|
||||
RabiClone.CURRENT_MAP.setMap(currentMapData);
|
||||
} else {
|
||||
resetAndReloadEventData(RabiClone.CURRENT_MAP);
|
||||
return RabiClone.CURRENT_MAP.getMap();
|
||||
}
|
||||
} else {
|
||||
map.initializeMap();
|
||||
}
|
||||
RabiClone.CURRENT_MAP=map;
|
||||
Map newMap = RabiClone.CURRENT_MAP.getMap()!=null?RabiClone.CURRENT_MAP.getMap():new Map();
|
||||
DataInputStream stream = new DataInputStream(new FileInputStream(map.getFile()));
|
||||
int marker=0;
|
||||
|
@ -24,6 +24,14 @@ public enum Maps {
|
||||
return map;
|
||||
}
|
||||
|
||||
public void initializeMap() {
|
||||
map = new Map();
|
||||
}
|
||||
|
||||
public void setMap(Map m) {
|
||||
this.map=m;
|
||||
}
|
||||
|
||||
public void ModifyTile(int x,int y,Tile t) {
|
||||
map.ModifyTile(x, y, t);
|
||||
//System.out.println("Tile "+(y*MAP_WIDTH+x)+" is now "+tiles[y*MAP_WIDTH+x]+".");
|
||||
|
Loading…
x
Reference in New Issue
Block a user