diff --git a/static/js/index.js b/static/js/index.js index 7df1a38..e47480c 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -122,6 +122,7 @@ class Game extends GameBasic { let { player } = this; if (player.health <= 0) { + let that = this; this.ws.close(); this.ws = new WebSocket(origin); this.ws.addEventListener('message', function (e) { that.recv(e) });