player is now nullable; wtf is calling Ingame 5 times?

This commit is contained in:
minjaesong
2018-09-17 01:46:50 +09:00
parent 5049400b3b
commit d95eaf5be0
35 changed files with 252 additions and 150 deletions

View File

@@ -29,7 +29,8 @@ object WorldCamera {
inline val yCentre: Int
get() = y + height.ushr(1)
fun update(world: GameWorld, player: ActorWBMovable) {
fun update(world: GameWorld, player: ActorWBMovable?) {
if (player == null) return
width = FastMath.ceil(Terrarum.WIDTH / (Terrarum.ingame?.screenZoom ?: 1f)) // div, not mul
height = FastMath.ceil(Terrarum.HEIGHT / (Terrarum.ingame?.screenZoom ?: 1f))