game pausing when player has no energy to act
Posted: Thu Nov 10, 2011 7:47 pm
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:
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()