Propagate constant third parameter of call_object_create_egg

This commit is contained in:
Kp 2016-12-05 00:26:11 +00:00
parent 19528a85d0
commit 515476f02b
4 changed files with 22 additions and 22 deletions

View file

@ -280,7 +280,7 @@ objptridx_t object_create_robot_egg(int type, int id, int num, const vms_vector
// Interface to object_create_egg, puts count objects of type type, id
// = id in objp and then drops them.
objptridx_t call_object_create_egg(const object_base &objp, int count, int type, int id);
objptridx_t call_object_create_egg(const object_base &objp, unsigned count, int id);
void dead_player_end();

View file

@ -1832,7 +1832,7 @@ static objptridx_t maybe_drop_primary_weapon_egg(const object &playerobj, int we
const auto powerup_num = Primary_weapon_to_powerup[weapon_index];
auto &player_info = playerobj.ctype.player_info;
if (player_info.primary_weapon_flags & weapon_flag)
return call_object_create_egg(playerobj, 1, OBJ_POWERUP, powerup_num);
return call_object_create_egg(playerobj, 1, powerup_num);
else
return object_none;
}
@ -1842,7 +1842,7 @@ static void maybe_drop_secondary_weapon_egg(const object_base &playerobj, int we
const auto powerup_num = Secondary_weapon_to_powerup[weapon_index];
int max_count = min(count, 3);
for (int i=0; i<max_count; i++)
call_object_create_egg(playerobj, 1, OBJ_POWERUP, powerup_num);
call_object_create_egg(playerobj, 1, powerup_num);
}
static void drop_missile_1_or_4(const object &playerobj,int missile_index)
@ -1853,8 +1853,8 @@ static void drop_missile_1_or_4(const object &playerobj,int missile_index)
if (num_missiles > 10)
num_missiles = 10;
call_object_create_egg(playerobj, num_missiles/4, OBJ_POWERUP, powerup_id+1);
call_object_create_egg(playerobj, num_missiles%4, OBJ_POWERUP, powerup_id);
call_object_create_egg(playerobj, num_missiles / 4, powerup_id + 1);
call_object_create_egg(playerobj, num_missiles % 4, powerup_id);
}
namespace dsx {
@ -1943,36 +1943,36 @@ void drop_player_eggs(const vobjptridx_t playerobj)
(plr_laser_level > MAX_LASER_LEVEL && (laser_level_and_id = {plr_laser_level - MAX_LASER_LEVEL, POW_SUPER_LASER}, true)) ||
#endif
(plr_laser_level && (laser_level_and_id = {plr_laser_level, POW_LASER}, true)))
call_object_create_egg(playerobj, laser_level_and_id.first, OBJ_POWERUP, laser_level_and_id.second);
call_object_create_egg(playerobj, laser_level_and_id.first, laser_level_and_id.second);
// Drop quad laser if appropos
if (player_info.powerup_flags & PLAYER_FLAGS_QUAD_LASERS)
call_object_create_egg(playerobj, 1, OBJ_POWERUP, POW_QUAD_FIRE);
call_object_create_egg(playerobj, 1, POW_QUAD_FIRE);
if (player_info.powerup_flags & PLAYER_FLAGS_CLOAKED)
call_object_create_egg(playerobj, 1, OBJ_POWERUP, POW_CLOAK);
call_object_create_egg(playerobj, 1, POW_CLOAK);
#if defined(DXX_BUILD_DESCENT_II)
if (player_info.powerup_flags & PLAYER_FLAGS_MAP_ALL)
call_object_create_egg(playerobj, 1, OBJ_POWERUP, POW_FULL_MAP);
call_object_create_egg(playerobj, 1, POW_FULL_MAP);
if (player_info.powerup_flags & PLAYER_FLAGS_AFTERBURNER)
call_object_create_egg(playerobj, 1, OBJ_POWERUP, POW_AFTERBURNER);
call_object_create_egg(playerobj, 1, POW_AFTERBURNER);
if (player_info.powerup_flags & PLAYER_FLAGS_AMMO_RACK)
call_object_create_egg(playerobj, 1, OBJ_POWERUP, POW_AMMO_RACK);
call_object_create_egg(playerobj, 1, POW_AMMO_RACK);
if (player_info.powerup_flags & PLAYER_FLAGS_CONVERTER)
call_object_create_egg(playerobj, 1, OBJ_POWERUP, POW_CONVERTER);
call_object_create_egg(playerobj, 1, POW_CONVERTER);
if (player_info.powerup_flags & PLAYER_FLAGS_HEADLIGHT)
call_object_create_egg(playerobj, 1, OBJ_POWERUP, POW_HEADLIGHT);
call_object_create_egg(playerobj, 1, POW_HEADLIGHT);
// drop the other enemies flag if you have it
if (game_mode_capture_flag() && (player_info.powerup_flags & PLAYER_FLAGS_FLAG))
{
call_object_create_egg(playerobj, 1, OBJ_POWERUP, get_team (get_player_id(playerobj)) == TEAM_RED ? POW_FLAG_BLUE : POW_FLAG_RED);
call_object_create_egg(playerobj, 1, get_team(get_player_id(playerobj)) == TEAM_RED ? POW_FLAG_BLUE : POW_FLAG_RED);
}
@ -1981,7 +1981,7 @@ void drop_player_eggs(const vobjptridx_t playerobj)
// Drop hoard orbs
unsigned max_count = min(secondary_ammo[PROXIMITY_INDEX], static_cast<uint8_t>(12));
for (int i=0; i<max_count; i++)
call_object_create_egg(playerobj, 1, OBJ_POWERUP, POW_HOARD_ORB);
call_object_create_egg(playerobj, 1, POW_HOARD_ORB);
}
#endif
@ -2056,7 +2056,7 @@ void drop_player_eggs(const vobjptridx_t playerobj)
if (amount)
for (;;)
{
call_object_create_egg(playerobj, 1, OBJ_POWERUP, POW_VULCAN_AMMO);
call_object_create_egg(playerobj, 1, POW_VULCAN_AMMO);
if (amount <= VULCAN_AMMO_AMOUNT)
break;
amount -= VULCAN_AMMO_AMOUNT;
@ -2065,8 +2065,8 @@ void drop_player_eggs(const vobjptridx_t playerobj)
// Always drop a shield and energy powerup.
if (Game_mode & GM_MULTI) {
call_object_create_egg(playerobj, 1, OBJ_POWERUP, POW_SHIELD_BOOST);
call_object_create_egg(playerobj, 1, OBJ_POWERUP, POW_ENERGY);
call_object_create_egg(playerobj, 1, POW_SHIELD_BOOST);
call_object_create_egg(playerobj, 1, POW_ENERGY);
}
}
}

View file

@ -640,7 +640,7 @@ void maybe_drop_net_powerup(powerup_type_t powerup_type, bool adjust_cap, bool r
//--old-- segnum /= 2;
Net_create_loc = 0;
const auto &&objnum = call_object_create_egg(vobjptr(Players[pnum].objnum), 1, OBJ_POWERUP, powerup_type);
const auto &&objnum = call_object_create_egg(vobjptr(Players[pnum].objnum), 1, powerup_type);
if (objnum == object_none)
return;
@ -1046,10 +1046,10 @@ objptridx_t object_create_robot_egg(const vobjptr_t objp)
// -------------------------------------------------------------------------------------------------------
// Put count objects of type type (eg, powerup), id = id (eg, energy) into *objp, then drop them! Yippee!
// Returns created object number.
objptridx_t call_object_create_egg(const object_base &objp, int count, int type, int id)
objptridx_t call_object_create_egg(const object_base &objp, const unsigned count, const int id)
{
if (count > 0) {
return object_create_player_egg(type, id, count, objp.mtype.phys_info.velocity, objp.pos, vsegptridx(objp.segnum));
return object_create_player_egg(OBJ_POWERUP, id, count, objp.mtype.phys_info.velocity, objp.pos, vsegptridx(objp.segnum));
}
return object_none;

View file

@ -2232,7 +2232,7 @@ static void multi_do_create_powerup(const playernum_t pnum, const ubyte *buf)
}
Net_create_loc = 0;
const auto &&my_objnum = call_object_create_egg(vobjptr(Players[pnum].objnum), 1, OBJ_POWERUP, powerup_type);
const auto &&my_objnum = call_object_create_egg(vobjptr(Players[pnum].objnum), 1, powerup_type);
if (my_objnum == object_none) {
return;