mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
sprites can be rendered across the world seam
This commit is contained in:
@@ -38,26 +38,26 @@ object PickaxeCore {
|
||||
// return false if hitting actors
|
||||
// ** below is commented out -- don't make actors obstruct the way of digging **
|
||||
/*var ret1 = true
|
||||
Terrarum.ingame!!.actorContainerActive.forEach {
|
||||
INGAME.actorContainerActive.forEach {
|
||||
if (it is ActorWBMovable && it.hIntTilewiseHitbox.intersects(mousePoint))
|
||||
ret1 = false // return is not allowed here
|
||||
}
|
||||
if (!ret1) return ret1*/
|
||||
|
||||
// return false if here's no tile
|
||||
if (Block.AIR == (Terrarum.ingame!!.world).getTileFromTerrain(mouseTileX, mouseTileY))
|
||||
if (Block.AIR == (INGAME.world).getTileFromTerrain(mouseTileX, mouseTileY))
|
||||
return false
|
||||
|
||||
// filter passed, do the job
|
||||
val swingDmgToFrameDmg = delta.toDouble() / actorvalue.getAsDouble(AVKey.ACTION_INTERVAL)!!
|
||||
|
||||
(Terrarum.ingame!!.world).inflictTerrainDamage(
|
||||
(INGAME.world).inflictTerrainDamage(
|
||||
mouseTileX, mouseTileY,
|
||||
Calculate.pickaxePower(player, item.material) * swingDmgToFrameDmg
|
||||
)?.let { tileBroken ->
|
||||
val drop = BlockCodex[tileBroken].drop
|
||||
if (drop.isNotBlank()) {
|
||||
Terrarum.ingame!!.addNewActor(DroppedItem(drop, mouseTileX * TILE_SIZE, mouseTileY * TILE_SIZE))
|
||||
INGAME.addNewActor(DroppedItem(drop, mouseTileX * TILE_SIZE, mouseTileY * TILE_SIZE))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user