Move object ammo init into drop_powerup
This backports into Descent 1 the special-case that loads a Vulcan cannon when it is dropped. It also fixes a longstanding bug that a robot that drops more than one of the powerup would fill only one of them.
This commit is contained in:
parent
8c350ed5a5
commit
b028cce25b
|
@ -809,7 +809,6 @@ void maybe_replace_powerup_with_energy(const vmobjptr_t del_obj)
|
|||
}
|
||||
|
||||
#if defined(DXX_BUILD_DESCENT_I)
|
||||
#define drop_powerup(id, num, init_vel, pos, segnum, player) (drop_powerup)(id, num, init_vel, pos, segnum)
|
||||
static
|
||||
#endif
|
||||
imobjptridx_t drop_powerup(int id, const unsigned num, const vms_vector &init_vel, const vms_vector &pos, const vmsegptridx_t segnum, const bool player)
|
||||
|
@ -893,6 +892,17 @@ imobjptridx_t drop_powerup(int id, const unsigned num, const vms_vector &init_ve
|
|||
if (Game_mode & GM_MULTI)
|
||||
obj->lifeleft /= 2;
|
||||
break;
|
||||
#if defined(DXX_BUILD_DESCENT_II)
|
||||
case POW_OMEGA_WEAPON:
|
||||
if (!player)
|
||||
obj->ctype.powerup_info.count = MAX_OMEGA_CHARGE;
|
||||
break;
|
||||
case POW_GAUSS_WEAPON:
|
||||
#endif
|
||||
case POW_VULCAN_WEAPON:
|
||||
if (!player)
|
||||
obj->ctype.powerup_info.count = VULCAN_WEAPON_AMMO_AMOUNT;
|
||||
break;
|
||||
default:
|
||||
// if (Game_mode & GM_MULTI)
|
||||
// obj->lifeleft = (d_rand() + F1_0*3) * 64; // Lives for 5 to 5.5 binary minutes (a binary minute is 64 seconds)
|
||||
|
@ -1025,20 +1035,7 @@ imobjptridx_t object_create_robot_egg(const int type, const int id, const int nu
|
|||
}
|
||||
}
|
||||
#endif
|
||||
const auto &&rval = drop_robot_egg(type, id, num, init_vel, pos, segnum);
|
||||
#if defined(DXX_BUILD_DESCENT_II)
|
||||
if (rval != object_none)
|
||||
{
|
||||
if (type == OBJ_POWERUP)
|
||||
{
|
||||
if (id == POW_VULCAN_WEAPON || id == POW_GAUSS_WEAPON)
|
||||
rval->ctype.powerup_info.count = VULCAN_WEAPON_AMMO_AMOUNT;
|
||||
else if (id == POW_OMEGA_WEAPON)
|
||||
rval->ctype.powerup_info.count = MAX_OMEGA_CHARGE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return rval;
|
||||
return drop_robot_egg(type, id, num, init_vel, pos, segnum);
|
||||
}
|
||||
|
||||
imobjptridx_t object_create_robot_egg(const vmobjptr_t objp)
|
||||
|
|
Loading…
Reference in a new issue