update the ghost sparingly

This commit is contained in:
minjaesong
2023-09-29 00:00:11 +09:00
parent 430de3dcbf
commit e5adc7c908

View File

@@ -67,20 +67,23 @@ open class FixtureItemBase(originalID: ItemID, val fixtureClassName: String) : G
} }
(INGAME as TerrarumIngame).blockMarkingActor.let { // update the ghost sparingly
val item = ghostItem.get() if (INGAME.WORLD_UPDATE_TIMER % 2 == 0) {
(INGAME as TerrarumIngame).blockMarkingActor.let {
val item = ghostItem.get()
it.setGhost(item) it.setGhost(item)
it.update(delta) it.update(delta)
it.setGhostColourBlock() it.setGhostColourBlock()
mouseInInteractableRange(actor) { _, _, mx, my -> mouseInInteractableRange(actor) { _, _, mx, my ->
if (item.canSpawnHere(mx, my)) { if (item.canSpawnHere(mx, my)) {
it.setGhostColourAllow() it.setGhostColourAllow()
}
else {
it.setGhostColourDeny()
}
0L
} }
else {
it.setGhostColourDeny()
}
0L
} }
} }
} }