mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-05 15:00:29 +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:
parent
c0f3ca81fb
commit
2a8efb3fd5
@ -1,5 +1,5 @@
|
||||
# Mod properties
|
||||
mod_version=1.89.0
|
||||
mod_version=1.89.1
|
||||
|
||||
# Minecraft properties
|
||||
mc_version=1.12.2
|
||||
|
@ -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 );
|
||||
|
@ -1,3 +1,7 @@
|
||||
# New features in CC: Tweaked 1.89.1
|
||||
|
||||
* Fix crashes when rendering monitors of varying sizes.
|
||||
|
||||
# New features in CC: Tweaked 1.89.0
|
||||
|
||||
* Compress monitor data, reducing network traffic by a significant amount.
|
||||
|
@ -1,10 +1,5 @@
|
||||
New features in CC: Tweaked 1.89.0
|
||||
New features in CC: Tweaked 1.89.1
|
||||
|
||||
* Compress monitor data, reducing network traffic by a significant amount.
|
||||
* Allow limiting the bandwidth monitor updates use.
|
||||
* Several optimisations to monitor rendering (@Lignum)
|
||||
|
||||
And several bug fixes:
|
||||
* Fix settings.load failing on defined settings.
|
||||
* Fix crashes when rendering monitors of varying sizes.
|
||||
|
||||
Type "help changelog" to see the full version history.
|
||||
|
Loading…
Reference in New Issue
Block a user