mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 11:04:05 +09:00
fix: fixture pickup avail check is now done properly
This commit is contained in:
@@ -1264,9 +1264,9 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
|||||||
val fixturesUnderHand = ArrayList<FixtureBase>()
|
val fixturesUnderHand = ArrayList<FixtureBase>()
|
||||||
val mobsUnderHand = ArrayList<ActorWithBody>()
|
val mobsUnderHand = ArrayList<ActorWithBody>()
|
||||||
actorsUnderMouse.forEach {
|
actorsUnderMouse.forEach {
|
||||||
if (it is FixtureBase && it.mainUI == null)
|
if (it is FixtureBase) // && it.mainUI == null) // pickup avail check must be done against fixture.canBeDespawned
|
||||||
fixturesUnderHand.add(it)
|
fixturesUnderHand.add(it)
|
||||||
else
|
else if (it !is FixtureBase)
|
||||||
mobsUnderHand.add(it)
|
mobsUnderHand.add(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ open class FixtureBase : ActorWithBody, CuedByTerrainChange {
|
|||||||
|
|
||||||
if (canBeDespawned) {
|
if (canBeDespawned) {
|
||||||
printdbg(this, "despawn at T${INGAME.WORLD_UPDATE_TIMER}: ${nameFun()}")
|
printdbg(this, "despawn at T${INGAME.WORLD_UPDATE_TIMER}: ${nameFun()}")
|
||||||
printStackTrace(this)
|
// printStackTrace(this)
|
||||||
|
|
||||||
// remove filler block
|
// remove filler block
|
||||||
forEachBlockbox { x, y, _, _ ->
|
forEachBlockbox { x, y, _, _ ->
|
||||||
@@ -312,7 +312,13 @@ open class FixtureBase : ActorWithBody, CuedByTerrainChange {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun flagDespawn() {
|
override fun flagDespawn() {
|
||||||
if (canBeDespawned) flagDespawn = true
|
if (canBeDespawned) {
|
||||||
|
printdbg(this, "Fixture at (${this.intTilewiseHitbox}) flagging despawn: ${this.javaClass.canonicalName}")
|
||||||
|
flagDespawn = true
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printdbg(this, "Fixture at (${this.intTilewiseHitbox}) CANNOT be despawned: ${this.javaClass.canonicalName}")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class FixtureLogicSignalEmitter : FixtureBase, Electric {
|
|||||||
val itemImage = FixtureItemBase.getItemImageFromSingleImage("basegame", "sprites/fixtures/signal_source.tga")
|
val itemImage = FixtureItemBase.getItemImageFromSingleImage("basegame", "sprites/fixtures/signal_source.tga")
|
||||||
|
|
||||||
density = 1400.0
|
density = 1400.0
|
||||||
setHitboxDimension(TILE_SIZE, TILE_SIZE, 0, -1)
|
setHitboxDimension(TILE_SIZE, TILE_SIZE, 0, 1)
|
||||||
|
|
||||||
makeNewSprite(TextureRegionPack(itemImage.texture, TILE_SIZE, TILE_SIZE)).let {
|
makeNewSprite(TextureRegionPack(itemImage.texture, TILE_SIZE, TILE_SIZE)).let {
|
||||||
it.setRowsAndFrames(1,1)
|
it.setRowsAndFrames(1,1)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ internal class FixtureStorageChest : FixtureBase {
|
|||||||
(mainUI as UIStorageChest).chestInventory = this.inventory!!
|
(mainUI as UIStorageChest).chestInventory = this.inventory!!
|
||||||
(mainUI as UIStorageChest).chestNameFun = this.nameFun
|
(mainUI as UIStorageChest).chestNameFun = this.nameFun
|
||||||
|
|
||||||
setHitboxDimension(TILE_SIZE, TILE_SIZE, 0, -1)
|
setHitboxDimension(TILE_SIZE, TILE_SIZE, 0, 1)
|
||||||
|
|
||||||
makeNewSprite(TextureRegionPack(CommonResourcePool.getAsTextureRegion("itemplaceholder_16").texture, 16, 16)).let {
|
makeNewSprite(TextureRegionPack(CommonResourcePool.getAsTextureRegion("itemplaceholder_16").texture, 16, 16)).let {
|
||||||
it.setRowsAndFrames(1,1)
|
it.setRowsAndFrames(1,1)
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ open class FixtureSwingingDoorBase : FixtureBase {
|
|||||||
(if (isOpacityActuallyLuminosity) lightBoxList else shadeBoxList)[0].light = opacity
|
(if (isOpacityActuallyLuminosity) lightBoxList else shadeBoxList)[0].light = opacity
|
||||||
|
|
||||||
// define physical size
|
// define physical size
|
||||||
setHitboxDimension(TILE_SIZE * tilewiseHitboxWidth, TILE_SIZE * tilewiseHitboxHeight, 0, 0)
|
setHitboxDimension(TILE_SIZE * tilewiseHitboxWidth, TILE_SIZE * tilewiseHitboxHeight, 0, 1)
|
||||||
blockBox = BlockBox(BlockBox.FULL_COLLISION, tilewiseHitboxWidth, tilewiseHitboxHeight)
|
blockBox = BlockBox(BlockBox.FULL_COLLISION, tilewiseHitboxWidth, tilewiseHitboxHeight)
|
||||||
|
|
||||||
doorHoldLength = hashMapOf(
|
doorHoldLength = hashMapOf(
|
||||||
|
|||||||
Reference in New Issue
Block a user