zoom: Adjust inner zoom limit to safe value

Any value greater than 1004 can cause an overflow with a large height, causing 3dzoom to be zero, crashing the renderer
This commit is contained in:
Max Weber
2018-11-05 19:23:06 -07:00
parent cd15227585
commit f614a45845

View File

@@ -47,6 +47,13 @@ import net.runelite.client.plugins.PluginDescriptor;
) )
public class ZoomPlugin extends Plugin implements KeyListener public class ZoomPlugin extends Plugin implements KeyListener
{ {
/**
* The largest (most zoomed in) value that can be used without the client crashing.
*
* Larger values trigger an overflow in the engine's fov to scale code.
*/
private static final int INNER_ZOOM_LIMIT = 1004;
private boolean controlDown; private boolean controlDown;
@Inject @Inject
@@ -84,7 +91,7 @@ public class ZoomPlugin extends Plugin implements KeyListener
if ("innerZoomLimit".equals(event.getEventName()) && zoomConfig.innerLimit()) if ("innerZoomLimit".equals(event.getEventName()) && zoomConfig.innerLimit())
{ {
intStack[intStackSize - 1] = 1200; intStack[intStackSize - 1] = INNER_ZOOM_LIMIT;
return; return;
} }