Skip to content

Commit

Permalink
fix(core): fix bug where entity wasn't clearing properly
Browse files Browse the repository at this point in the history
entity would still be on the add entity list as it hasn't been added yet so it would be added after it was removed
  • Loading branch information
NoahBres committed Aug 29, 2020
1 parent 617b85e commit 0565806
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/kotlin/com/noahbres/meepmeep/MeepMeep.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ open class MeepMeep(private val windowSize: Int) {
val windowFrame = WindowFrame("Meep Meep", windowSize)
val canvas = windowFrame.canvas

protected var bg: Image? = null
private var bg: Image? = null

protected val colorManager = ColorManager()
private val colorManager = ColorManager()

protected val entityList = mutableListOf<Entity>()
private val entityList = mutableListOf<Entity>()
private val requestedAddEntityList = mutableListOf<Entity>()
private val requestedClearEntityList = mutableListOf<Entity>()

Expand Down Expand Up @@ -341,6 +341,7 @@ open class MeepMeep(private val windowSize: Int) {

fun removeEntity(entity: Entity): MeepMeep {
entityList.remove(entity)
requestedAddEntityList.remove(entity)
entityListDirty = true


Expand Down

0 comments on commit 0565806

Please sign in to comment.