From 2db40ed8c4dd5c0acd025bc1f16a9175349d1b2d Mon Sep 17 00:00:00 2001 From: John Bintz Date: Tue, 10 Nov 2009 22:06:35 -0500 Subject: [PATCH] better fix --- classes/ComicPressStoryline.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/classes/ComicPressStoryline.inc b/classes/ComicPressStoryline.inc index 55f28db..0ad8bce 100644 --- a/classes/ComicPressStoryline.inc +++ b/classes/ComicPressStoryline.inc @@ -156,11 +156,13 @@ class ComicPressStoryline { if (isset($this->_structure[$id])) { $all_adjacent = array(); do { + $new_id = $this->_structure[$id][$direction]; + $has_adjacent = false; - if (!in_array($id, $all_adjacent)) { + if (!in_array($new_id, $all_adjacent)) { if ($has_adjacent = isset($this->_structure[$id][$direction])) { - $all_adjacent[] = $this->_structure[$id][$direction]; - $id = $this->_structure[$id][$direction]; + $all_adjacent[] = $new_id; + $id = $new_id; } } } while ($has_adjacent);