mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-04-17 04:21:23 +00:00
Fix crashes when rendering monitors of varying sizes
When calling .flip(), we limit the size of the buffer. However, this limit is not reset when writing the next time, which means we get out-of-bounds errors, even if the buffer is /technically/ big enough. Clearing the buffer before drawing (rather than just resetting the position) is enough to fix this. Fixes #476 (and closes #477, which is a duplicate)
This commit is contained in:
@@ -170,7 +170,7 @@ public class TileEntityMonitorRenderer extends TileEntitySpecialRenderer<TileMon
|
||||
}
|
||||
|
||||
ByteBuffer monitorBuffer = tboContents;
|
||||
monitorBuffer.position( 0 );
|
||||
monitorBuffer.clear();
|
||||
for( int y = 0; y < height; y++ )
|
||||
{
|
||||
TextBuffer text = terminal.getLine( y ), textColour = terminal.getTextColourLine( y ), background = terminal.getBackgroundColourLine( y );
|
||||
|
||||
Reference in New Issue
Block a user