editing map/portals now changes map_version

This commit is contained in:
Zeno Rogue 2022-10-27 00:02:10 +02:00
parent f4282e1118
commit 3ce5597cc1
2 changed files with 10 additions and 1 deletions

View File

@ -755,6 +755,7 @@ EX void show_portals() {
unconnected.push_back(tcw); unconnected.push_back(tcw);
connections.erase(cw); connections.erase(cw);
connections.erase(tcw); connections.erase(tcw);
mapeditor::map_version++;
}); });
} }
else if(in_list) { else if(in_list) {
@ -771,6 +772,7 @@ EX void show_portals() {
dialog::addItem(XLAT("connect " + lalign(0, p)), dialog::list_fake_key++); dialog::addItem(XLAT("connect " + lalign(0, p)), dialog::list_fake_key++);
dialog::add_action([p, cw] { dialog::add_action([p, cw] {
connect_portal(cw, p, edit_spin); connect_portal(cw, p, edit_spin);
mapeditor::map_version++;
erase_unconnected(p); erase_unconnected(p);
}); });
} }

View File

@ -10,6 +10,9 @@ namespace hr {
EX namespace mapeditor { EX namespace mapeditor {
/* changes when the map is changed */
EX int map_version;
EX bool drawing_tool; EX bool drawing_tool;
EX bool intexture; EX bool intexture;
EX bool snapping; EX bool snapping;
@ -1492,7 +1495,7 @@ EX namespace mapeditor {
break; break;
} }
case 2: { case 2: {
if(anyshiftclick) { c->land = laNone; c->wall = waNone; break; } if(anyshiftclick) { c->land = laNone; c->wall = waNone; map_version++; break; }
eLand last = c->land; eLand last = c->land;
c->land = eLand(paintwhat); c->land = eLand(paintwhat);
if(isIcyLand(c) && isIcyLand(last)) if(isIcyLand(c) && isIcyLand(last))
@ -1510,6 +1513,7 @@ EX namespace mapeditor {
case 3: { case 3: {
eWall last = c->wall; eWall last = c->wall;
c->wall = eWall(anyshiftclick ? paintwhat_alt_wall : paintwhat); c->wall = eWall(anyshiftclick ? paintwhat_alt_wall : paintwhat);
map_version++;
if(last != c->wall) { if(last != c->wall) {
if(hasTimeout(c)) if(hasTimeout(c))
@ -1532,6 +1536,7 @@ EX namespace mapeditor {
break; break;
} }
case 5: case 5:
map_version++;
c->land = laNone; c->land = laNone;
c->wall = waNone; c->wall = waNone;
c->item = itNone; c->item = itNone;
@ -1540,11 +1545,13 @@ EX namespace mapeditor {
// c->tmp = -1; // c->tmp = -1;
break; break;
case 6: case 6:
map_version++;
c->land = laCanvas; c->land = laCanvas;
c->wall = ((GDIM == 3) ^ anyshiftclick) ? waWaxWall : waNone; c->wall = ((GDIM == 3) ^ anyshiftclick) ? waWaxWall : waNone;
c->landparam = paintwhat >> 8; c->landparam = paintwhat >> 8;
break; break;
case 4: { case 4: {
map_version++;
cell *copywhat = where.second.at; cell *copywhat = where.second.at;
c->wall = copywhat->wall; c->wall = copywhat->wall;
c->item = copywhat->item; c->item = copywhat->item;