Remove return value truncation in find_object_seg
This commit is contained in:
parent
98f5afa9f8
commit
a32d9f01a1
|
@ -261,7 +261,7 @@ int update_object_seg(vobjptridx_t obj);
|
|||
// any segment, returns -1. Note: This function is defined in
|
||||
// gameseg.h, but object.h depends on gameseg.h, and object.h is where
|
||||
// object is defined...get it?
|
||||
segnum_t find_object_seg(vobjptr_t obj);
|
||||
segptridx_t find_object_seg(vobjptr_t obj);
|
||||
|
||||
// go through all objects and make sure they have the correct segment
|
||||
// numbers used when debugging is on
|
||||
|
|
|
@ -828,8 +828,9 @@ static void move_object_to_position(const vobjptridx_t objp, const vms_vector &n
|
|||
if (fate == HIT_WALL) {
|
||||
|
||||
objp->pos = hit_info.hit_pnt;
|
||||
auto new_segnum = find_object_seg(objp);
|
||||
obj_relink(objp, vsegptridx(new_segnum));
|
||||
const auto &&segp = find_object_seg(objp);
|
||||
if (segp != segment_none)
|
||||
obj_relink(objp, segp);
|
||||
} else {
|
||||
editor_status("Attempted to move object out of mine. Object not moved.");
|
||||
}
|
||||
|
|
|
@ -1933,7 +1933,7 @@ void reset_objects(int n_objs)
|
|||
}
|
||||
|
||||
//Tries to find a segment for an object, using find_point_seg()
|
||||
segnum_t find_object_seg(const vobjptr_t obj)
|
||||
segptridx_t find_object_seg(const vobjptr_t obj)
|
||||
{
|
||||
return find_point_seg(obj->pos, vsegptridx(obj->segnum));
|
||||
}
|
||||
|
@ -1949,7 +1949,7 @@ int update_object_seg(const vobjptridx_t obj)
|
|||
return 0;
|
||||
|
||||
if ( newseg != obj->segnum )
|
||||
obj_relink(obj, vsegptridx(newseg));
|
||||
obj_relink(obj, newseg);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue