mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 19:44:05 +09:00
Physics stuff Float -> Double
Former-commit-id: 54ccee75769691aa6aaa2416767bd15270f63347 Former-commit-id: 61e892434f48adf11e3ca49b60928a930fd5cde9
This commit is contained in:
@@ -20,7 +20,7 @@ internal class SetAV : ConsoleCommand {
|
||||
echo.execute("${ccW}Set actor value of specific target to desired value.")
|
||||
echo.execute("${ccW}Usage: ${ccY}setav ${ccG}(id) <av> <val>")
|
||||
echo.execute("${ccW}blank ID for player")
|
||||
echo.execute("${ccR}Contaminated (float -> string) ActorValue will crash the game,")
|
||||
echo.execute("${ccR}Contaminated (double -> string) ActorValue will crash the game,")
|
||||
echo.execute("${ccR}so make sure it will not happen before you issue the command!")
|
||||
echo.execute("${ccW}Use ${ccG}__true ${ccW}and ${ccG}__false ${ccW}for boolean value.")
|
||||
}
|
||||
@@ -35,7 +35,7 @@ internal class SetAV : ConsoleCommand {
|
||||
catch (e: NumberFormatException) {
|
||||
|
||||
try {
|
||||
`val` = arg.toFloat() // try for float
|
||||
`val` = arg.toDouble() // try for double
|
||||
}
|
||||
catch (ee: NumberFormatException) {
|
||||
if (arg.equals("__true", ignoreCase = true)) {
|
||||
|
||||
@@ -16,12 +16,12 @@ class SpawnPhysTestBall : ConsoleCommand {
|
||||
val mouseX = Terrarum.appgc.input.mouseX
|
||||
val mouseY = Terrarum.appgc.input.mouseY
|
||||
|
||||
val elasticity = args[1].toFloat()
|
||||
val elasticity = args[1].toDouble()
|
||||
|
||||
val ball = PhysTestBall()
|
||||
ball.setPosition(
|
||||
(mouseX + MapCamera.cameraX).toFloat(),
|
||||
(mouseY + MapCamera.cameraY).toFloat()
|
||||
(mouseX + MapCamera.cameraX).toDouble(),
|
||||
(mouseY + MapCamera.cameraY).toDouble()
|
||||
)
|
||||
ball.elasticity = elasticity
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class TeleportPlayer : ConsoleCommand {
|
||||
return
|
||||
}
|
||||
|
||||
Terrarum.game.player.setPosition(x.toFloat(), y.toFloat())
|
||||
Terrarum.game.player.setPosition(x.toDouble(), y.toDouble())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user