From 559f5a9a9d93aa63c1c5b163c3ff82f536b21b83 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Sat, 3 Feb 2024 15:20:22 +0900 Subject: [PATCH] dropped items now visible in the dark --- .../terrarum/modulebasegame/gameactors/DroppedItem.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/net/torvald/terrarum/modulebasegame/gameactors/DroppedItem.kt b/src/net/torvald/terrarum/modulebasegame/gameactors/DroppedItem.kt index 8ad6804bd..a4d4a5c2c 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameactors/DroppedItem.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameactors/DroppedItem.kt @@ -33,7 +33,7 @@ open class DroppedItem : ActorWithBody { var itemCount = 1L - protected constructor() + protected constructor() : super(RenderOrder.OVERLAY, PhysProperties.PHYSICS_OBJECT) private var timeSinceSpawned = 0f @@ -51,7 +51,7 @@ open class DroppedItem : ActorWithBody { * @param topLeftX world-wise coord * @param topLeftY world-wise coord */ - constructor(itemID: ItemID, centreX: Double, bottomY: Double, spawnVelo: Vector2? = null) : super(RenderOrder.MIDTOP, PhysProperties.PHYSICS_OBJECT) { + constructor(itemID: ItemID, centreX: Double, bottomY: Double, spawnVelo: Vector2? = null) : super(RenderOrder.OVERLAY, PhysProperties.PHYSICS_OBJECT) { this.itemID = itemID if (itemID.isActor()) @@ -141,6 +141,8 @@ open class DroppedItem : ActorWithBody { } override fun update(delta: Float) { + renderOrder = RenderOrder.OVERLAY // for some reason the "overlaying" won't work without this + if (this.itemID.isBlock() || this.itemID.isItem()) { this.lightBoxList[0].light = getLum(this.itemID) }