Browse Source

Update index.js

Fruit 8 years ago
parent
commit
e406baaee6
1 changed files with 5 additions and 1 deletions
  1. 5 1
      index.js

+ 5 - 1
index.js

@@ -1,8 +1,12 @@
+const GameState = require('tera-game-state');
+
 module.exports = function antiBodyBlock(dispatch) {
+  const game = GameState(dispatch);
   const command = require("command")(dispatch);
   const partyMembers = new Set();
   const cache = Object.create(null);
   const partyObj = Object.create(null);
+  
   let interval = null;
   let enabled = true;
 
@@ -18,7 +22,7 @@ module.exports = function antiBodyBlock(dispatch) {
     }
   };
   
-  dispatch.hook('S_LOGIN', 10, evt => {
+  game.on('enter_game', () => {
     if (!enabled) {
       interval = setInterval(removeBodyBlock, 5000);
     }