Skip to content

Commit c4429fe

Browse files
authored
Fixed in-buffer block overwrites not going to the end of the buffer (#79)
Previously, in-buffer block overwrites would put the new block at the same place in the buffer order as the old block, which could lead to incorrect behavior. Fixes #77.
1 parent b818bfe commit c4429fe

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

gdpc/editor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ def _placeSingleBlockGlobalBuffered(self, position: ivec3, block: Block):
478478
Returns whether placement succeeded."""
479479
if len(self._buffer) >= self.bufferLimit:
480480
self.flushBuffer()
481+
self._buffer.pop(position, None) # Ensure the new block is added at the *end* of the buffer.
481482
self._buffer[position] = block
482483
return True
483484

0 commit comments

Comments
 (0)