int LocalObjectSelectNextinSegment(void) { int rval, first_obj; rval = ObjectSelectNextinSegment(); first_obj = Cur_object_index; if (Cur_object_index != -1) { while (!is_legal_type_for_this_window(Cur_object_index)) { rval = ObjectSelectNextinSegment(); if (first_obj == Cur_object_index) break; } Cur_goody_type = Objects[Cur_object_index].contains_type; Cur_goody_id = Objects[Cur_object_index].contains_id; if (Objects[Cur_object_index].contains_count < 0) Objects[Cur_object_index].contains_count = 0; Cur_goody_count = Objects[Cur_object_index].contains_count; } if (Cur_object_index != first_obj) set_view_target_from_segment(Cursegp); return rval; }
static int LocalObjectSelectNextinSegment(void) { int rval, first_obj; rval = ObjectSelectNextinSegment(); first_obj = Cur_object_index; if (Cur_object_index != object_none) { while (!is_legal_type_for_this_window(Cur_object_index)) { rval = ObjectSelectNextinSegment(); if (first_obj == Cur_object_index) break; } const auto &&objp = vobjptr(Cur_object_index); Cur_goody_type = objp->contains_type; Cur_goody_id = objp->contains_id; if (objp->contains_count < 0) objp->contains_count = 0; Cur_goody_count = objp->contains_count; } if (Cur_object_index != first_obj) set_view_target_from_segment(Cursegp); return rval; }
// ------------------------------------------------------------------------------------------------------ // Delete current object, if it exists. // If it doesn't exist, reformat Matt's hard disk, even if he is in Boston. int ObjectDelete(void) { if (Cur_object_index != object_none) { auto delete_objnum = Cur_object_index; ObjectSelectNextinSegment(); obj_delete(vobjptridx(delete_objnum)); if (delete_objnum == Cur_object_index) Cur_object_index = object_none; Update_flags |= UF_WORLD_CHANGED; } return 1; }
// ------------------------------------------------------------------------------------------------------ // Delete current object, if it exists. // If it doesn't exist, reformat Matt's hard disk, even if he is in Boston. int ObjectDelete(void) { if (Cur_object_index != -1) { int delete_objnum; delete_objnum = Cur_object_index; ObjectSelectNextinSegment(); obj_delete(delete_objnum); if (delete_objnum == Cur_object_index) Cur_object_index = -1; Update_flags |= UF_WORLD_CHANGED; } return 1; }