how do atomicsomething work

This commit is contained in:
minjaesong
2022-12-17 20:15:41 +09:00
parent 39318b1508
commit b14e3085d6

View File

@@ -59,12 +59,13 @@ open class FixtureItemBase(originalID: ItemID, val fixtureClassName: String) : G
override fun effectWhileEquipped(actor: ActorWithBody, delta: Float) { override fun effectWhileEquipped(actor: ActorWithBody, delta: Float) {
// println("ghost: ${ghostItem}; ghostInit = $ghostInit; instance: $hash") // println("ghost: ${ghostItem}; ghostInit = $ghostInit; instance: $hash")
if (!ghostInit.get()) { if (!ghostInit.compareAndExchangeAcquire(false, true)) {
ghostItem.getAndSet(makeFixture()) ghostItem.set(makeFixture())
ghostInit.getAndSet(true)
// printdbg(this, "ghost item initialised: $ghostItem") // printdbg(this, "ghost item initialised: $ghostItem")
} }
(INGAME as TerrarumIngame).blockMarkingActor.let { (INGAME as TerrarumIngame).blockMarkingActor.let {
it.setGhost(ghostItem.get()) it.setGhost(ghostItem.get())
it.isVisible = true it.isVisible = true