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) {
// println("ghost: ${ghostItem}; ghostInit = $ghostInit; instance: $hash")
if (!ghostInit.get()) {
ghostItem.getAndSet(makeFixture())
ghostInit.getAndSet(true)
if (!ghostInit.compareAndExchangeAcquire(false, true)) {
ghostItem.set(makeFixture())
// printdbg(this, "ghost item initialised: $ghostItem")
}
(INGAME as TerrarumIngame).blockMarkingActor.let {
it.setGhost(ghostItem.get())
it.isVisible = true