fix: fixtures not placing actorblocks

This commit is contained in:
minjaesong
2021-08-11 18:01:34 +09:00
parent 7bb921321f
commit 740eab3e84
7 changed files with 45 additions and 40 deletions

View File

@@ -283,7 +283,7 @@ open class GameWorld : Disposable {
wallDamages.remove(LandUtil.getBlockAddr(this, x, y))
if (!bypassEvent)
Terrarum.ingame?.queueWallChangedEvent(oldWall, itemID, LandUtil.getBlockAddr(this, x, y))
Terrarum.ingame?.queueWallChangedEvent(oldWall, itemID, x, y)
}
/**
@@ -313,7 +313,7 @@ open class GameWorld : Disposable {
// fluid tiles-item should be modified so that they will also place fluid onto their respective map
if (!bypassEvent)
Terrarum.ingame?.queueTerrainChangedEvent(oldTerrain, itemID, LandUtil.getBlockAddr(this, x, y))
Terrarum.ingame?.queueTerrainChangedEvent(oldTerrain, itemID, x, y)
}
fun setTileWire(x: Int, y: Int, tile: ItemID, bypassEvent: Boolean) {
@@ -328,7 +328,7 @@ open class GameWorld : Disposable {
wirings[blockAddr]!!.wires.add(tile)
if (!bypassEvent)
Terrarum.ingame?.queueWireChangedEvent(tile, false, LandUtil.getBlockAddr(this, x, y))
Terrarum.ingame?.queueWireChangedEvent(tile, false, x, y)
// figure out wiring graphs

View File

@@ -496,7 +496,7 @@ object WorldSimulator {
if (world.getAllWiresFrom(point.x, point.y)?.filter { WireCodex[it].accepts == wireType }?.isEmpty() != false)
break
printdbg(this, branchesVisited)
//printdbg(this, branchesVisited)
// get all wires that matches 'accepts' (such as Red/Green/Blue wire) and propagate signal for each of them
world.getAllWiresFrom(point.x, point.y)?.filter { WireCodex[it].accepts == wireType }?.forEach { wire ->
@@ -506,14 +506,14 @@ object WorldSimulator {
val signal = node.emitState
val cnx = node.connections.toInt() // 1-15
val nextDirBit = cnx and (15 - point.fromWhere) // cnx minus where the old cursur was; also 1-15
printdbg(this, "(${point.x}, ${point.y}) from ${point.fromWhere} to $nextDirBit")
//printdbg(this, "(${point.x}, ${point.y}) from ${point.fromWhere} to $nextDirBit")
// mark current position as visited
branchesVisited.add(point.copy())
// termination condition 1
if (branchesVisited.linearSearch { it.x == point.x && it.y == point.y }!! < branchesVisited.lastIndex) {
printdbg(this, "(${point.x}, ${point.y}) was already visited")
//printdbg(this, "(${point.x}, ${point.y}) was already visited")
dequeue()
}
else {
@@ -549,10 +549,10 @@ object WorldSimulator {
}
}
printdbg(this, "Point = $point")
//printdbg(this, "Point = $point")
} // end While
printdbg(this, "------------------------------------------")
//printdbg(this, "------------------------------------------")
}
}