game pausing when player has no energy to act

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

game pausing when player has no energy to act

#1 Post 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()

Predawn
Thalore
Posts: 127
Joined: Fri Sep 24, 2010 10:40 am
Location: East Sussex, England

Re: game pausing when player has no energy to act

#2 Post by Predawn »

Would that explain why digging a tunnel means you must press a key before moving again?
Predawn

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: game pausing when player has no energy to act

#3 Post 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 :)

Post Reply