mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Make MapEditEvent more complete
SetBlocksNotSent is no longer used.
This commit is contained in:
parent
62ee02b8ba
commit
7701e70dc9
7 changed files with 26 additions and 31 deletions
16
src/map.h
16
src/map.h
|
@ -79,21 +79,21 @@ struct MapEditEvent
|
|||
|
||||
MapEditEvent() = default;
|
||||
|
||||
// Sets the event's position and marks the block as modified.
|
||||
void setPositionModified(v3s16 pos)
|
||||
{
|
||||
p = pos;
|
||||
modified_blocks.insert(getNodeBlockPos(pos));
|
||||
}
|
||||
|
||||
VoxelArea getArea() const
|
||||
{
|
||||
switch(type){
|
||||
case MEET_ADDNODE:
|
||||
return VoxelArea(p);
|
||||
case MEET_REMOVENODE:
|
||||
return VoxelArea(p);
|
||||
case MEET_SWAPNODE:
|
||||
return VoxelArea(p);
|
||||
case MEET_BLOCK_NODE_METADATA_CHANGED:
|
||||
{
|
||||
v3s16 np1 = p*MAP_BLOCKSIZE;
|
||||
v3s16 np2 = np1 + v3s16(1,1,1)*MAP_BLOCKSIZE - v3s16(1,1,1);
|
||||
return VoxelArea(np1, np2);
|
||||
}
|
||||
return VoxelArea(p);
|
||||
case MEET_OTHER:
|
||||
{
|
||||
VoxelArea a;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue