tag: remove_sdl1_2
commit 8d0eadc73eed006ed4bb28ccfebabf7dae1a40fd
Author: Kai Sterker <[email protected]>
Commit: Kai Sterker <[email protected]>
FIXED Erek potentially getting stuck in cellar hallway (hopefully!)
---
scripts/schedules/mapcharacters/erek.py | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/scripts/schedules/mapcharacters/erek.py
b/scripts/schedules/mapcharacters/erek.py
index c127703..8ae3137 100755
--- a/scripts/schedules/mapcharacters/erek.py
+++ b/scripts/schedules/mapcharacters/erek.py
@@ -52,7 +52,6 @@ class erek (schedule.speak):
(12, 1, adonthell.STAND_NORTH), \
(2, 4, adonthell.STAND_SOUTH)]
- self.index = 0
self.walk_delay = "45t"
if self.myself.get_val ("goto") != 0:
@@ -89,11 +88,12 @@ class erek (schedule.speak):
# -- set alternative schedule
self.myself.set_callback (self.leave_cellar)
- x, y, dir = self.to_common[self.index]
+ x, y, dir = self.to_common[0]
self.myself.set_goal (x, y, dir)
+ self.myself.set_val ("index", 0)
def leave_cellar (self):
- self.index = self.index + 1
+ index = self.myself.get_val ("index") + 1
goto = self.myself.get_val ("goto")
# -- goto first floor
@@ -101,9 +101,10 @@ class erek (schedule.speak):
# -- goto common room
else: coords = self.to_common
- if self.index < len (coords):
- x, y, dir = coords[self.index]
+ if index < len (coords):
+ x, y, dir = coords[index]
self.myself.set_goal (x, y, dir)
+ self.myself.set_val ("index", index)
# -- arrived
else:
_______________________________________________
Adonthell-commits mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/adonthell-commits