mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 20:14:05 +09:00
fix: bombs are making NaN amount of damage
This commit is contained in:
@@ -645,6 +645,8 @@ open class GameWorld(
|
||||
* @return true if block is broken
|
||||
*/
|
||||
fun inflictTerrainDamage(x: Int, y: Int, damage: Double): ItemID? {
|
||||
if (damage.isNaN()) throw IllegalArgumentException("Cannot inflict NaN amount of damage at($x, $y)")
|
||||
|
||||
val damage = damage.toFloat()
|
||||
val addr = LandUtil.getBlockAddr(this, x, y)
|
||||
|
||||
@@ -679,6 +681,8 @@ open class GameWorld(
|
||||
* @return true if block is broken
|
||||
*/
|
||||
fun inflictWallDamage(x: Int, y: Int, damage: Double): ItemID? {
|
||||
if (damage.isNaN()) throw IllegalArgumentException("Cannot inflict NaN amount of damage at($x, $y)")
|
||||
|
||||
val damage = damage.toFloat()
|
||||
val addr = LandUtil.getBlockAddr(this, x, y)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user