Remove unnecessary middleman ed.swapmap

When the game loads a room in a custom level, previously it would load
the tilemap of that room into ed.swapmap, and then mapclass::loadlevel()
would manually go through each element in ed.swapmap to set each tile in
`contents`. Why do that, when you can just return the vector from
editorclass::loadlevel() and set it directly? ed.swapmap is really
unnecessary.
This commit is contained in:
Misa
2020-05-21 19:23:21 -07:00
committed by Ethan Lee
parent 6913abb171
commit 4301a70f2d
3 changed files with 8 additions and 19 deletions

View File

@@ -1568,18 +1568,12 @@ void mapclass::loadlevel(int rx, int ry)
roomname=ed.level[curlevel].roomname;
}
extrarow = 1;
ed.loadlevel(rx, ry);
contents = ed.loadlevel(rx, ry);
roomtexton = false;
roomtext.clear();
for (int edj = 0; edj < 30; edj++){
for(int edi = 0; edi < 40; edi++){
contents[edi + vmult[edj]] = ed.swapmap[edi + vmult[edj]];
}
}
//Entities have to be created HERE, akwardly
int tempcheckpoints=0;
int tempscriptbox=0;