in choose_drop_segment let fallback correctly check for reactor segment

This commit is contained in:
zicodxx 2012-04-07 10:58:46 +02:00
parent 84a3eb2fac
commit 45e351e46c
2 changed files with 9 additions and 0 deletions

View file

@ -1,5 +1,9 @@
D2X-Rebirth Changelog
20120407
--------
main/fireball.c: in choose_drop_segment let fallback correctly check for reactor segment
20120405
--------
main/multi.c: variable declarations come first

View file

@ -577,8 +577,13 @@ int choose_drop_segment()
}
if (segnum == -1) {
cur_drop_depth = BASE_NET_DROP_DEPTH;
while (cur_drop_depth > 0 && segnum == -1) // before dropping in random segment, try to find ANY segment which is connected to the player responsible for the drop so object will not spawn in inaccessible areas
{
segnum = pick_connected_segment(&Objects[Players[Player_num].objnum], --cur_drop_depth);
if (Segment2s[segnum].special == SEGMENT_IS_CONTROLCEN)
segnum = -1;
}
return ((segnum == -1)?((d_rand() * Highest_segment_index) >> 15):segnum); // basically it should be impossible segnum == -1 now... but oh well...
} else
return segnum;