mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-17 05:54:05 +09:00
spawning of dropped item
This commit is contained in:
@@ -49,7 +49,7 @@ open class ActorWithBody(renderOrder: RenderOrder, val physProp: PhysProperties)
|
||||
/** This is GameWorld? only because the title screen also uses this thing as its camera;
|
||||
* titlescreen does not use instance of Ingame.
|
||||
*/
|
||||
private val world: GameWorld?
|
||||
protected val world: GameWorld?
|
||||
get() = Terrarum.ingame?.world
|
||||
|
||||
|
||||
|
||||
@@ -33,8 +33,6 @@ class WireActor(id: ActorID) : ActorWithBody(RenderOrder.WIRES, PhysProperties.I
|
||||
private var worldX = 0
|
||||
private var worldY = 0
|
||||
|
||||
private val world: GameWorld
|
||||
get() = Terrarum.ingame!!.world
|
||||
|
||||
/**
|
||||
* @param itemID must start with "wire@"
|
||||
@@ -58,7 +56,7 @@ class WireActor(id: ActorID) : ActorWithBody(RenderOrder.WIRES, PhysProperties.I
|
||||
|
||||
sprite!!.currentRow = 0
|
||||
|
||||
val nearbyTiles = getNearbyTilesPos(worldX, worldY).map { world.getAllWiresFrom(it.x, it.y) }
|
||||
val nearbyTiles = getNearbyTilesPos(worldX, worldY).map { world!!.getAllWiresFrom(it.x, it.y) }
|
||||
var ret = 0
|
||||
for (i in 0..3) {
|
||||
if (nearbyTiles[i]?.contains(itemID) == true) {
|
||||
|
||||
Reference in New Issue
Block a user