fixture ghost is now red when it cant be placed there

This commit is contained in:
minjaesong
2023-09-28 23:40:58 +09:00
parent ebe63916d7
commit 430de3dcbf
9 changed files with 146 additions and 124 deletions

View File

@@ -34,10 +34,10 @@ class ItemHomeComputer(originalID: ItemID) : GameItem(originalID) {
equipPosition = EquipPosition.HAND_GRIP
}
override fun startPrimaryUse(actor: ActorWithBody, delta: Float) = mouseInInteractableRange(actor) {
override fun startPrimaryUse(actor: ActorWithBody, delta: Float) = mouseInInteractableRange(actor) { _, _, mtx, mty ->
val item = FixtureHomeComputer()
if (item.spawn(Terrarum.mouseTileX, Terrarum.mouseTileY, if (actor is IngamePlayer) actor.uuid else null)) 1L else -1L
if (item.spawn(mtx, mty, if (actor is IngamePlayer) actor.uuid else null)) 1L else -1L
// return true when placed, false when cannot be placed
}
}