Page 1 of 1

game pausing when player has no energy to act

Posted: Thu Nov 10, 2011 7:47 pm
by tiger_eye
Sometimes the game can pause when the player doesn't have enough energy to act. This can happen, for example, after running into a trap, tunneling (which uses "rest" functions), becoming confused, etc. When this happens, pressing a key doesn't perform an action--it simply lets the other actors act until the player has enough energy to act again.

This is easy enough to fix:

Code: Select all

Index: game/modules/tome/class/Player.lua
===================================================================
--- game/modules/tome/class/Player.lua	(revision 4640)
+++ game/modules/tome/class/Player.lua	(working copy)
@@ -247,7 +247,7 @@
 	end
 
 	-- Resting ? Running ? Otherwise pause
-	if not self:restStep() and not self:runStep() and self.player then
+	if not self:restStep() and not self:runStep() and self.player and self:enoughEnergy() then
 		game.paused = true
 	elseif not self.player then
 		self:useEnergy()

Re: game pausing when player has no energy to act

Posted: Sat Nov 12, 2011 7:54 pm
by Predawn
Would that explain why digging a tunnel means you must press a key before moving again?

Re: game pausing when player has no energy to act

Posted: Mon Nov 14, 2011 5:19 am
by tiger_eye
Predawn wrote:Would that explain why digging a tunnel means you must press a key before moving again?
It sure does, Predawn. Hence, this is fixed for b35 :)