Page 1 of 1

Rush can produce lua errors with invasion portals

Posted: Sun Mar 17, 2013 7:13 pm
by Hachem_Muche
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.

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")

Re: Rush can produce lua errors with invasion portals

Posted: Sun Mar 17, 2013 8:56 pm
by R_D
This happened to me on version 1.0.0 as well. I used wanderer's rest active ability (telekinetic leap) to jump onto a demon invasion portal. I wasn't taken inside, so I stepped off and back on. I can't remember if/when I got any .lua errors, but I know that when I returned from the portal, I was taken to the entrance of that floor instead of where the portal was, and I found that while the portal was gone, demons were still spawning infinitely from the now-disappeared portal.

Re: Rush can produce lua errors with invasion portals

Posted: Sun Apr 21, 2013 11:51 pm
by darkgod
fixed