added missing condition for hasController

It also wireframes on Ubuntu with openjdk version 1.8.0_111


Former-commit-id: 594bc71d65b68cd185bf8ac322d9ae66ada47604
Former-commit-id: fce5fefe993c0729b80a5c46c0c37bd3bd5ca8de
This commit is contained in:
Minjae Song
2016-11-18 01:05:11 +09:00
committed by Song Minjae
parent da93bd695c
commit 900121779b
3 changed files with 4 additions and 4 deletions

View File

@@ -89,8 +89,10 @@ constructor(gamename: String) : StateBasedGame(gamename) {
try {
hasController = gc.input.controllerCount > 0
// check if the first controller is actually available
Controllers.getController(0).getAxisValue(0)
if (hasController) {
// check if the first controller is actually available
Controllers.getController(0).getAxisValue(0)
}
}
catch (e: ArrayIndexOutOfBoundsException) {
hasController = false

View File

@@ -1,6 +1,5 @@
package net.torvald.terrarum.console
import com.sun.javaws.exceptions.InvalidArgumentException
import net.torvald.imagefont.GameFontBase
import net.torvald.terrarum.Terrarum

View File

@@ -1,7 +1,6 @@
package net.torvald.terrarum.mapgenerator
import net.torvald.random.HQRNG
import com.sun.javaws.exceptions.InvalidArgumentException
import java.util.Random