Fixed controller support when VR is not active.
*/
package org.terasology.engine.subsystem.openvr;
import org.terasology.assets.module.ModuleAwareAssetTypeManager;
+import org.terasology.config.Config;
import org.terasology.context.Context;
import org.terasology.engine.modes.GameState;
import org.terasology.engine.subsystem.EngineSubsystem;
private OpenVRControllers controllerDevice;
+ Config config;
+
/**
* Get the name of this subsystem.
* @return the name of the subsystem, a string.
@@ -65,6 +68,10 @@ public void registerCoreAssetTypes(ModuleAwareAssetTypeManager assetTypeManager)
*/
@Override
public void postInitialise(Context rootContext) {
+ config = context.get(Config.class);
+ if (!config.getRendering().isVrSupport()) {
+ return;
+ }
this.context = rootContext;
InputSystem inputSystem = context.get(InputSystem.class);
if (inputSystem == null) {
