Wipe metadata when placing schematics

This probably isn't very optimised but it works and doesn't seem to hold
things up a lot (but schematic placing is already quite fast so maybe it
would with larger schematics).
master
luk3yx 2021-08-11 18:45:58 +12:00 committed by MoNTE48
parent 7ed95a454d
commit 8c2db140ce
1 changed files with 11 additions and 0 deletions

View File

@ -269,6 +269,17 @@ void Schematic::placeOnMap(ServerMap *map, v3s16 p, u32 flags,
//// Carry out post-map-modification actions
if (force_place) {
v3s16 npos;
for (npos.X = p.X; npos.X < p.X + s.X; npos.X++) {
for (npos.Y = p.Y; npos.Y < p.Y + s.Y; npos.Y++) {
for (npos.Z = p.Z; npos.Z < p.Z + s.Z; npos.Z++) {
map->removeNodeMetadata(npos);
}
}
}
}
//// Create & dispatch map modification events to observers
MapEditEvent event;
event.type = MEET_OTHER;