void make_dball(struct char_data *ch)
{
room_rnum location = NOWHERE;
int infinite_loop = 0;
struct obj_data *dball;
while (location == NOWHERE && infinite_loop < 5000) {
location = real_room(number(100, 158));
infinite_loop++;
}
dball = read_object(1201, VIRTUAL);
obj_to_room(dball, location);
}
I wrote this code awhile back. It's a scattering code for a dragonball. I was taking it look at it and notice that it can only scatter to rooms 100-158.
while (location == NOWHERE && infinite_loop < 5000) {
location = real_room(number(100, 158));
infinite_loop++;
}
I was wondering if there is a way I can change that so it finds all rooms created already and randomly picks one to assign the item too? Thanks.


