Simplify do_missile_firing lookup of track_goal
Commit 81dd23b151
("Only charge player for weapons that fire successfully")
added an early return when `objnum == object_none`, so if execution
reaches the call to `multi_send_fire`, then the object is guaranteed to
exist. Access the track_goal without rechecking whether the object
exists.
This commit is contained in:
parent
9cf82a8eb5
commit
f22b627949
|
@ -2403,7 +2403,8 @@ void do_missile_firing(int drop_bomb)
|
|||
|
||||
if (Game_mode & GM_MULTI)
|
||||
{
|
||||
multi_send_fire(weapon+MISSILE_ADJUST, laser_level::_1 /* unused */, gun_flag, objnum == object_none ? object_none : objnum->ctype.laser_info.track_goal, weapon_index_is_player_bomb(weapon) ? objnum : object_none);
|
||||
const object &obj = *objnum;
|
||||
multi_send_fire(weapon+MISSILE_ADJUST, laser_level::_1 /* unused */, gun_flag, obj.ctype.laser_info.track_goal, weapon_index_is_player_bomb(weapon) ? objnum : object_none);
|
||||
}
|
||||
|
||||
// don't autoselect if dropping prox and prox not current weapon
|
||||
|
|
Loading…
Reference in a new issue