Rush can produce lua errors with invasion portals
Posted: Sun Mar 17, 2013 7:13 pm
If you move onto either the naga or fearscape invasion portals by a means other than normal movement, the prompt to enter or destroy does not come up and you can switch level manually. Returning to the main level creates a lua error.
Since the block_move function for the tile cannot return true, the fix is switch it to an on_move function and eliminate the force check.
Since the block_move function for the tile cannot return true, the fix is switch it to an on_move function and eliminate the force check.
Code: Select all
Index: game/modules/tome/data/general/events/fearscape-portal.lua
===================================================================
--- game/modules/tome/data/general/events/fearscape-portal.lua (revision 6570)
+++ game/modules/tome/data/general/events/fearscape-portal.lua (working copy)
@@ -152,19 +152,19 @@
self.real_change = nil
return true
end
-g.block_move = function(self, x, y, who, act, couldpass)
- if not who or not who.player or not act then return false end
+g.on_move = function(self, x, y, who, act, couldpass)
+ if not who or not who.player then return false end
if self.broken then
game.log("#VIOLET#The portal is already broken!")
return false
end
require("engine.ui.Dialog"):yesnoPopup("Fearscape Portal", "Do you wish to enter the portal or just destroy it?", function(ret)
game.log("#VIOLET#The portal is broken!")
if not ret then
self:change_level_check()
end
self.broken = true
+ self.name = "broken fearscape invasion portal"
self.change_level = nil
self.autoexplore_ignore = true
end, "Destroy", "Enter")
Index: game/modules/tome/data/general/events/naga-portal.lua
===================================================================
--- game/modules/tome/data/general/events/naga-portal.lua (revision 6570)
+++ game/modules/tome/data/general/events/naga-portal.lua (working copy)
@@ -121,19 +121,19 @@
self.real_change = nil
return true
end
-g.block_move = function(self, x, y, who, act, couldpass)
- if not who or not who.player or not act then return false end
+g.on_move = function(self, x, y, who, act, couldpass)
+ if not who or not who.player then return false end
if self.broken then
game.log("#VIOLET#The portal is already broken!")
return false
end
require("engine.ui.Dialog"):yesnoPopup("Coral Portal", "Do you wish to enter the portal or just destroy it?", function(ret)
game.log("#VIOLET#The portal is broken!")
if not ret then
self:change_level_check()
end
self.broken = true
+ self.name = "broken naga invasion coral portal"
self.change_level = nil
self.autoexplore_ignore = true
end, "Destroy", "Enter")