fix: lightbox would not load from save due to API change? idk but now savegame and avatar is incompatible

This commit is contained in:
minjaesong
2023-05-16 01:05:31 +09:00
parent 28c45b5756
commit c74cfa6eb9
6 changed files with 10 additions and 10 deletions

View File

@@ -50,7 +50,7 @@ open class ActorWithBody : Actor {
*
* NOTE: MUST NOT SERIALISE (use `@Transient`)
*/
open var lightBoxList: List<Lightbox> = emptyList()
open var lightBoxList: ArrayList<Lightbox> = arrayListOf() // must use ArrayList: has no-arg constructor
/**
* Arguments:
@@ -60,7 +60,7 @@ open class ActorWithBody : Actor {
*
* NOTE: MUST NOT SERIALISE (use `@Transient`)
*/
open var shadeBoxList: List<Lightbox> = emptyList()
open var shadeBoxList: ArrayList<Lightbox> = arrayListOf() // must use ArrayList: has no-arg constructor
// end of Luminous
protected constructor() : super()

View File

@@ -99,9 +99,9 @@ open class ActorHumanoid : ActorWithBody, Controllable, Pocketed, Factionable, L
* Hitbox(x-offset, y-offset, width, height)
* (Use ArrayList for normal circumstances)
*/
@Transient override var lightBoxList: List<Lightbox> = listOf(Lightbox(Hitbox(2.0, 2.0, baseHitboxW - 3.0, baseHitboxH - 3.0), Cvec(0)))
@Transient override var lightBoxList: ArrayList<Lightbox> = arrayListOf(Lightbox(Hitbox(2.0, 2.0, baseHitboxW - 3.0, baseHitboxH - 3.0), Cvec(0)))
// the actual values are update on the update()
@Transient override var shadeBoxList: List<Lightbox> = listOf(Lightbox(Hitbox(2.0, 2.0, baseHitboxW - 3.0, baseHitboxH - 3.0), Cvec(0)))
@Transient override var shadeBoxList: ArrayList<Lightbox> = arrayListOf(Lightbox(Hitbox(2.0, 2.0, baseHitboxW - 3.0, baseHitboxH - 3.0), Cvec(0)))
// the actual values are update on the update()
@Transient val BASE_DENSITY = 980.0

View File

@@ -39,9 +39,9 @@ open class DroppedItem : ActorWithBody {
private val randKey1 = (Math.random() * 256).toInt()
private val randKey2 = (Math.random() * 256).toInt()
override var lightBoxList = listOf(Lightbox(this.hitbox.clone().setPosition(0.0, 0.0), Cvec(0)))
override var lightBoxList = arrayListOf(Lightbox(this.hitbox.clone().setPosition(0.0, 0.0), Cvec(0)))
// the Cvec will be calculated dynamically on Update
override var shadeBoxList = listOf(Lightbox(this.hitbox.clone().setPosition(0.0, 0.0), Cvec(0)))
override var shadeBoxList = arrayListOf(Lightbox(this.hitbox.clone().setPosition(0.0, 0.0), Cvec(0)))
// the Cvec will be calculated dynamically on Update
/**

View File

@@ -43,9 +43,9 @@ open class FixtureSwingingDoorBase : FixtureBase {
private var pixelwiseHitboxHeight = TILE_SIZE * tilewiseHitboxHeight
private var tilewiseDistToAxis = tw - twClosed
@Transient override var lightBoxList = listOf(Lightbox(Hitbox(TILE_SIZED * tilewiseDistToAxis, 0.0, TILE_SIZED * twClosed, TILE_SIZED * th), Cvec(0)))
@Transient override var lightBoxList = arrayListOf(Lightbox(Hitbox(TILE_SIZED * tilewiseDistToAxis, 0.0, TILE_SIZED * twClosed, TILE_SIZED * th), Cvec(0)))
// the Cvec will be calculated dynamically on Update
@Transient override var shadeBoxList = listOf(Lightbox(Hitbox(TILE_SIZED * tilewiseDistToAxis, 0.0, TILE_SIZED * twClosed, TILE_SIZED * th), Cvec(0)))
@Transient override var shadeBoxList = arrayListOf(Lightbox(Hitbox(TILE_SIZED * tilewiseDistToAxis, 0.0, TILE_SIZED * twClosed, TILE_SIZED * th), Cvec(0)))
// the Cvec will be calculated dynamically on Update
protected var doorState = 0 // -1: open toward left, 0: closed, 1: open toward right

View File

@@ -23,7 +23,7 @@ internal class FixtureTikiTorch : FixtureBase {
private val rndHash1 = (Math.random() * 256).toInt()
private val rndHash2 = (Math.random() * 256).toInt()
@Transient override var lightBoxList = listOf(Lightbox(Hitbox(6.0, 5.0, 4.0, 3.0), BlockCodex[Block.TORCH].getLumCol(rndHash1, rndHash2)))
@Transient override var lightBoxList = arrayListOf(Lightbox(Hitbox(6.0, 5.0, 4.0, 3.0), BlockCodex[Block.TORCH].getLumCol(rndHash1, rndHash2)))
constructor() : super(
BlockBox(BlockBox.NO_COLLISION, 1, 2),

View File

@@ -39,7 +39,7 @@ open class ProjectileSimple : ActorWithBody, Projectile {
* Hitbox(x-offset, y-offset, width, height)
* (Use ArrayList for normal circumstances)
*/
@Transient override var lightBoxList = listOf(Lightbox(Hitbox(-4.0, -4.0, 8.0, 8.0), color)) // lightbox sized 8x8 centered to the bullet
@Transient override var lightBoxList = arrayListOf(Lightbox(Hitbox(-4.0, -4.0, 8.0, 8.0), color)) // lightbox sized 8x8 centered to the bullet
private val lifetimeMax = 2500