From c705433bec59d96d4d546ee96e9cd3967a71aa55 Mon Sep 17 00:00:00 2001 From: zicodxx <> Date: Thu, 20 Nov 2008 02:09:01 +0000 Subject: [PATCH] When we reached MAX_BOSS_TELEPORT_SEGS in init_boss_segments, make sure we also escape out of the for-loop - otherwise we still might overflow --- CHANGELOG.txt | 4 ++++ main/ai2.c | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fb97fb1e9..32f437539 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D2X-Rebirth Changelog +20081120 +-------- +main/ai2.c: When we reached MAX_BOSS_TELEPORT_SEGS in init_boss_segments, make sure we also escape out of the for-loop - otherwise we still might overflow + 20081119 -------- main/gamecntl.c: Actually demand ANY valid key to abort the Death sequence diff --git a/main/ai2.c b/main/ai2.c index cb1b29a59..8559bcd2c 100644 --- a/main/ai2.c +++ b/main/ai2.c @@ -304,6 +304,8 @@ if (size_check) #endif if (*num_segs >= MAX_BOSS_TELEPORT_SEGS) { tail = head; + sidenum=MAX_SIDES_PER_SEGMENT; + break; } } } @@ -1996,7 +1998,11 @@ void teleport_boss(object *objp) rand_index = (d_rand() * Num_boss_teleport_segs) >> 15; rand_segnum = Boss_teleport_segs[rand_index]; Assert((rand_segnum >= 0) && (rand_segnum <= Highest_segment_index)); - +int i; +printf("LIST_START\n"); +for (i=0; i