Commit b4b28ccde9edeb9fe777b3e63eb15cc36714cdf6
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 | 332 | function Block:getObstacle() |
333 | 333 | if self:isMonster() then |
334 | 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 | 338 | end |
337 | 339 | local data = self:getEventData() |
338 | 340 | if not data then return 0 end | ... | ... |