Skip to content

Commit

Permalink
Fix World Scale Crash When Not In VR
Browse files Browse the repository at this point in the history
  • Loading branch information
hammy275 committed Feb 18, 2024
1 parent 8d06ea5 commit bc78fd5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.vivecraft.client_vr.VRState;
import org.vivecraft.client_vr.gameplay.screenhandlers.KeyboardHandler;
import org.vivecraft.client_vr.provider.ControllerType;
import org.vivecraft.client_vr.settings.VRSettings;
import org.vivecraft.client_xr.render_pass.RenderPassType;

public final class ClientAPIImpl implements VivecraftClientAPI {
Expand Down Expand Up @@ -126,7 +127,11 @@ public boolean isVanillaRenderPass() {

@Override
public float getWorldScale() {
return ClientDataHolderVR.getInstance().vrPlayer.worldScale;
if (isVrActive()) {
return ClientDataHolderVR.getInstance().vrPlayer.worldScale;
} else {
return ClientDataHolderVR.getInstance().vrSettings.overrides.getSetting(VRSettings.VrOptions.WORLD_SCALE).getFloat();
}
}

@Override
Expand Down

0 comments on commit bc78fd5

Please sign in to comment.