Remove unnecessary wall number check in kill_stuck_objects
Callers are expected to filter out invalid numbers. Even if they do not, the only use of the number is to match entries in Stuck_objects. An invalid match could cause a call to vobjptr() with an invalid index, but that would be diagnosed by the valptridx checking, so no invalid memory access will occur.
This commit is contained in:
parent
278c10dec0
commit
e446965511
|
@ -262,7 +262,7 @@ void remove_obsolete_stuck_objects();
|
|||
void wall_set_tmap_num(vsegptridx_t seg,int side,vsegptridx_t csegp,int cside,int anim_num,int frame_num);
|
||||
|
||||
// Remove any flares from a wall
|
||||
void kill_stuck_objects(int wallnum);
|
||||
void kill_stuck_objects(wallnum_t wallnum);
|
||||
|
||||
#if defined(DXX_BUILD_DESCENT_II)
|
||||
//start wall open <-> closed transitions
|
||||
|
|
|
@ -1348,12 +1348,10 @@ void remove_obsolete_stuck_objects(void)
|
|||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// Door with wall index wallnum is opening, kill all objects stuck in it.
|
||||
void kill_stuck_objects(int wallnum)
|
||||
void kill_stuck_objects(const wallnum_t wallnum)
|
||||
{
|
||||
if (wallnum < 0 || Num_stuck_objects == 0) {
|
||||
if (!Num_stuck_objects)
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned n = 0;
|
||||
|
||||
range_for (auto &i, Stuck_objects)
|
||||
|
|
Loading…
Reference in a new issue