diff --git a/src/net/torvald/terrarum/gameactors/ActorWithBody.kt b/src/net/torvald/terrarum/gameactors/ActorWithBody.kt index 4062e1ed2..23110ee19 100644 --- a/src/net/torvald/terrarum/gameactors/ActorWithBody.kt +++ b/src/net/torvald/terrarum/gameactors/ActorWithBody.kt @@ -1764,9 +1764,12 @@ open class ActorWithBody : Actor { if (world == null) return val offsetX = 0f - val offsetY = 1f // plant to the ground + val offsetY = 0f // for some reason this value must be zero to draw the actor planted to the ground - drawBodyInGoodPosition(hitbox.startX.toFloat(), hitbox.startY.toFloat()) { x, y -> + val posX = hitbox.startX.plus(PHYS_EPSILON_DIST).toFloat() + val posY = hitbox.startY.plus(PHYS_EPSILON_DIST).toFloat() + + drawBodyInGoodPosition(posX, posY) { x, y -> sprite.render(batch, x + offsetX, y + offsetY, scale.toFloat()) } } diff --git a/src/net/torvald/terrarum/modulebasegame/console/Inventory.kt b/src/net/torvald/terrarum/modulebasegame/console/Inventory.kt index 6c8425837..8809e5445 100644 --- a/src/net/torvald/terrarum/modulebasegame/console/Inventory.kt +++ b/src/net/torvald/terrarum/modulebasegame/console/Inventory.kt @@ -14,16 +14,21 @@ import net.torvald.terrarum.modulebasegame.gameactors.Pocketed */ internal object Inventory : ConsoleCommand { - private var targetID: ActorID = INGAME.actorNowPlaying?.referenceID ?: PLAYER_REF_ID + private var targetID: ActorID = 0 + + private fun tryTargetActivePlayer() { + targetID = INGAME.actorNowPlaying?.referenceID ?: 0 + } override fun execute(args: Array) { if (args.size == 1) { printUsage() } else if (args[1] == "target") { - targetID = if (args[2].lowercase() == "player") (INGAME.actorNowPlaying?.referenceID ?: PLAYER_REF_ID) else args[2].toInt() + if (args[2].lowercase() == "player") tryTargetActivePlayer() else targetID = args[2].toInt() } else { + if (targetID == 0) tryTargetActivePlayer() val actor = getActor() if (actor != null) { when (args[1]) { @@ -36,7 +41,7 @@ internal object Inventory : ConsoleCommand { } } else { - Echo("Actor $targetID is not Pocketed or does not exists") + Echo("Actor $targetID is not Pocketed or does not exist") } } } diff --git a/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureWallCalendar.kt b/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureWallCalendar.kt index 3a7903356..c916a2453 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureWallCalendar.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureWallCalendar.kt @@ -1,5 +1,6 @@ package net.torvald.terrarum.modulebasegame.gameactors +import net.torvald.terrarum.INGAME import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZE import net.torvald.terrarum.gameactors.AVKey import net.torvald.terrarum.langpack.Lang @@ -27,5 +28,7 @@ class FixtureWallCalendar : FixtureBase { actorValue[AVKey.BASEMASS] = 1.0 } - + override var tooltipText: String? + get() = INGAME.world.worldTime.getFormattedCalendarDay() + set(value) {} } \ No newline at end of file