mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 19:44:05 +09:00
fix: damaging terrain would not queue the modified chunk for the autosave
This commit is contained in:
@@ -140,7 +140,7 @@ object ExplosionManager {
|
||||
|
||||
private fun memcpyToWorldBreakage(CALC_WIDTH: Int, world: GameWorld, xStart: Int, yStart: Int, yOff: Int, out: UnsafeFloatArray) {
|
||||
for (x in xStart until xStart + CALC_WIDTH) {
|
||||
world.inflictTerrainDamage(x, yStart + yOff, out[x - xStart, yOff].toDouble())
|
||||
world.inflictTerrainDamage(x, yStart + yOff, out[x - xStart, yOff].toDouble(), false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ object ExplosionManager {
|
||||
for (wx in worldXstart until worldXstart + CALC_WIDTH) {
|
||||
val lx = wx - (tx - CALC_RADIUS - 1)
|
||||
val ly = wy - (ty - CALC_RADIUS - 1)
|
||||
world.inflictTerrainDamage(wx, wy, mapBoomPow[lx, ly].blastToDmg().toDouble()).let { (tile, ore) ->
|
||||
world.inflictTerrainDamage(wx, wy, mapBoomPow[lx, ly].blastToDmg().toDouble(), false).let { (tile, ore) ->
|
||||
if (ore != null || tile != null) {
|
||||
// drop item
|
||||
val prob = if (ore != null) dropProbOre else dropProbNonOre
|
||||
|
||||
@@ -79,7 +79,8 @@ object AxeCore {
|
||||
|
||||
INGAME.world.inflictTerrainDamage(
|
||||
x, y,
|
||||
Calculate.hatchetPower(actor, item?.material) * swingDmgToFrameDmg
|
||||
Calculate.hatchetPower(actor, item?.material) * swingDmgToFrameDmg,
|
||||
false
|
||||
).let { tileBroken ->
|
||||
// tile busted
|
||||
if (tileBroken != null) {
|
||||
@@ -100,7 +101,8 @@ object AxeCore {
|
||||
|
||||
INGAME.world.inflictTerrainDamage(
|
||||
x, y,
|
||||
Calculate.hatchetPower(actor, item?.material) * swingDmgToFrameDmg
|
||||
Calculate.hatchetPower(actor, item?.material) * swingDmgToFrameDmg,
|
||||
false
|
||||
).let { (tileBroken, _) ->
|
||||
// tile busted
|
||||
if (tileBroken != null) {
|
||||
@@ -125,7 +127,8 @@ object AxeCore {
|
||||
|
||||
INGAME.world.inflictTerrainDamage(
|
||||
x, y,
|
||||
Calculate.hatchetPower(actor, item?.material) * swingDmgToFrameDmg
|
||||
Calculate.hatchetPower(actor, item?.material) * swingDmgToFrameDmg,
|
||||
false
|
||||
).let { (tileBroken, _) ->
|
||||
// tile busted
|
||||
if (tileBroken != null) {
|
||||
|
||||
@@ -93,7 +93,8 @@ object PickaxeCore {
|
||||
|
||||
INGAME.world.inflictTerrainDamage(
|
||||
x, y,
|
||||
Calculate.pickaxePower(actor, item?.material) * swingDmgToFrameDmg
|
||||
Calculate.pickaxePower(actor, item?.material) * swingDmgToFrameDmg,
|
||||
false
|
||||
).let { (tileBroken, oreBroken) ->
|
||||
|
||||
// drop ore
|
||||
|
||||
@@ -94,7 +94,8 @@ object SledgehammerCore {
|
||||
|
||||
INGAME.world.inflictWallDamage(
|
||||
x, y,
|
||||
Calculate.pickaxePower(actor, item?.material) * swingDmgToFrameDmg
|
||||
Calculate.pickaxePower(actor, item?.material) * swingDmgToFrameDmg,
|
||||
false
|
||||
).let { tileBroken ->
|
||||
// tile busted
|
||||
if (tileBroken != null) {
|
||||
|
||||
Reference in New Issue
Block a user