Remove always-true tests

This commit is contained in:
Kp 2014-07-16 02:35:26 +00:00
parent ec7eab42d6
commit bb66bbbff7
4 changed files with 5 additions and 10 deletions

View file

@ -2106,7 +2106,6 @@ void create_smart_children(objptridx_t objp, int num_smart_children)
#if defined(DXX_BUILD_DESCENT_I)
if (parent_type == OBJ_PLAYER) {
blob_id = PLAYER_SMART_HOMING_ID;
Assert(blob_id != -1); // Hmm, missing data in bitmaps.tbl. Need "children=NN" parameter.
} else {
blob_id = ((N_weapon_types<ROBOT_SMART_HOMING_ID)?(PLAYER_SMART_HOMING_ID):(ROBOT_SMART_HOMING_ID)); // NOTE: Shareware & reg 1.0 do not have their own Smart structure for bots. It was introduced in 1.4 to make Smart blobs from lvl 7 boss easier to dodge. So if we do not have this type, revert to player's Smart behaviour..,
}

View file

@ -1781,7 +1781,7 @@ static void multi_do_kill(const unsigned pnum, const ubyte *buf)
if (!multi_i_am_master() && type != MULTI_KILL_HOST)
return;
if ((pnum < 0) || (pnum >= N_players))
if (pnum >= N_players)
{
Int3(); // Invalid player number killed
return;
@ -2186,7 +2186,7 @@ static void multi_do_play_sound(const unsigned pnum, const ubyte *buf)
static void multi_do_score(const unsigned pnum, const ubyte *buf)
{
if ((pnum < 0) || (pnum >= N_players))
if (pnum >= N_players)
{
Int3(); // Non-terminal, see rob
return;
@ -2207,7 +2207,7 @@ static void multi_do_trigger(const unsigned pnum, const ubyte *buf)
{
int trigger = buf[2];
if ((pnum < 0) || (pnum >= N_players) || (pnum == Player_num))
if (pnum >= N_players || pnum == Player_num)
{
Int3(); // Got trigger from illegal playernum
return;
@ -2227,7 +2227,7 @@ static void multi_do_effect_blowup(const unsigned pnum, const ubyte *buf)
vms_vector hitpnt;
object dummy;
if ((pnum < 0) || (pnum >= N_players) || (pnum == Player_num))
if (pnum >= N_players || pnum == Player_num)
return;
multi_do_protocol_frame(1, 0); // force packets to be sent, ensuring this packet will be attached to following MULTI_TRIGGER

View file

@ -916,7 +916,7 @@ void multi_do_create_robot(const unsigned pnum, const ubyte *buf)
objnum = GET_INTEL_SHORT(buf + 3);
if ((pnum < 0) || (objnum < 0) || (fuelcen_num < 0) || (fuelcen_num >= Num_fuelcenters) || (pnum >= N_players))
if ((objnum < 0) || (fuelcen_num < 0) || (fuelcen_num >= Num_fuelcenters) || (pnum >= N_players))
{
Int3(); // Bogus data
return;

View file

@ -1297,10 +1297,6 @@ void wall_toggle(int segnum, int side)
// Tidy up Walls array for load/save purposes.
void reset_walls()
{
if (Num_walls < 0) {
return;
}
range_for (auto &w, partial_range(Walls, Num_walls, MAX_WALLS))
{
w.type = WALL_NORMAL;