Commit b4b28ccde9edeb9fe777b3e63eb15cc36714cdf6

Authored by zhouhaihai
1 parent 782c178b

数据保护

Showing 1 changed file with 3 additions and 1 deletions   Show diff stats
src/adv/AdvBlock.lua
@@ -332,7 +332,9 @@ end @@ -332,7 +332,9 @@ end
332 function Block:getObstacle() 332 function Block:getObstacle()
333 if self:isMonster() then 333 if self:isMonster() then
334 local enemy = self.room.map.adv.battle:getEnemy(self.room.roomId, self.blockId) 334 local enemy = self.room.map.adv.battle:getEnemy(self.room.roomId, self.blockId)
335 - return enemy:getObstacle() 335 + if enemy then
  336 + return enemy:getObstacle()
  337 + end
336 end 338 end
337 local data = self:getEventData() 339 local data = self:getEventData()
338 if not data then return 0 end 340 if not data then return 0 end