mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-19 06:54:05 +09:00
fixed a NaN bug caused by a zero-width/height hitbox
Also inventory is widened to 10x7 of prev 9x7
This commit is contained in:
@@ -71,6 +71,12 @@ class Hitbox(x1: Double, y1: Double, width: Double, height: Double) {
|
||||
|
||||
fun setPosition(x1: Double, y1: Double): Hitbox {
|
||||
hitboxStart = Point2d(x1, y1)
|
||||
|
||||
if (width == 0.0 || height == 0.0) {
|
||||
println("[Hitbox] width or height is zero, perhaps you want to check it out?")
|
||||
Thread.currentThread().stackTrace.forEach { println(it) }
|
||||
}
|
||||
|
||||
return this
|
||||
}
|
||||
fun setPosition(vector: Vector2) = setPosition(vector.x, vector.y)
|
||||
|
||||
Reference in New Issue
Block a user