so... now don't get mad... but I DID have it in my original iteration, just at the end, which was wrong, so thank you!
For future generations: The nowhere check has to be first as does the real_room to convert to a rnum before the while.
Code:
/* transfer NPC's equipment to corpse */
if (IS_NPC(ch)) {
for (i = 0; i < NUM_WEARS; i++)
if (GET_EQ(ch, i)) {
remove_otrigger(GET_EQ(ch, i), ch);
obj_to_obj(unequip_char(ch, i), corpse);
}
} else {
/* scatter player's equipment randomly across zone */
int top, bot, z, sendit;
z = world[IN_ROOM(ch)].zone;
bot = zone_table[z].bot;
top = zone_table[z].top;
for (i = 0; i < NUM_WEARS; i++)
if (GET_EQ(ch, i)) {
do {
sendit = real_room(rand_number(bot, top));
} while (sendit == NOWHERE || ROOM_FLAGGED(sendit, ROOM_DEATH) ||
ROOM_FLAGGED(sendit, ROOM_GODROOM) || ROOM_FLAGGED(sendit, ROOM_PRIVATE));
obj_to_room(unequip_char(ch, i), sendit);
}
}
@thomas - does C work from interior parenthesis... out? For instance: my sendit calculation it looks like it grabs the random number FIRST and then pipes it through real_room. This would be helpful in thinking how to construct solutions with multiple functions.
and thanks as always for your help and patience!