deengames-prototypes / virus-escape

A virus-escaping-the-network strategic puzzler.
0 stars 3 forks source link

Bug: Uncaught TypeError: antiVirus.moving is not a function #20

Closed ashes999 closed 6 years ago

ashes999 commented 6 years ago

Not sure how exactly to reproduce it. In some cases, being consumed while around/adjacent/under an anti-virus causes this stack trace:

level.js:68 Uncaught TypeError: antiVirus.moving is not a function
    at init.tickEvent (level.js:68)
    at init._runCallbacks (crafty-0.7.1.min.js:9)
    at Function.trigger (crafty-0.7.1.min.js:9)
    at init.moved (player.js:50)
    at init._runCallbacks (crafty-0.7.1.min.js:9)
    at Function.trigger (crafty-0.7.1.min.js:9)
    at init.moving (player.js:111)
    at init._runCallbacks (crafty-0.7.1.min.js:9)
    at Function.trigger (crafty-0.7.1.min.js:9)
    at Function.keyboardDispatch (crafty-0.7.1.min.js:9)

One such case:

ghost commented 6 years ago

This one seems very interesting, and hopefully, very fun to fix. I'll get back to you once I figure out what's going on.

ghost commented 6 years ago

Hmm... It seems that this error happens when an anti-virus entity is destroyed before trying to move. A harmless error, and an easy fix.

ashes999 commented 6 years ago

We should never try to move an entity that was just destroyed. It should be removed from some list/timer/whatever it is.

This is the bigger issue IMO, and a fix would be very welcome. I'm on the verge of declaring this game fun :) I just need to be able to progress without running into this issue.