is_proximity_bomb_or_smart_mine*: s/smart/player_smart/g
As documented in zico's commit 38fabd7c49
, robot smart mines have a
different ID number than player smart mines. Rename the test functions
to clarify that they only recognize player smart mines, but not robot
smart mines.
git grep -l is_proximity_bomb_or_smart_mine | xargs sed -i -e 's/is_proximity_bomb_or_smart_mine/is_proximity_bomb_or_player_smart_mine/g'
This commit is contained in:
parent
2ceb0168f2
commit
8997f622bd
|
@ -132,12 +132,12 @@ extern array<muzzle_info, MUZZLE_QUEUE_MAX> Muzzle_data;
|
|||
#ifdef dsx
|
||||
namespace d1x {
|
||||
|
||||
static inline int is_proximity_bomb_or_smart_mine(const weapon_id_type id)
|
||||
static inline int is_proximity_bomb_or_player_smart_mine(const weapon_id_type id)
|
||||
{
|
||||
return id == weapon_id_type::PROXIMITY_ID;
|
||||
}
|
||||
|
||||
static inline int is_proximity_bomb_or_smart_mine_or_placed_mine(const weapon_id_type id)
|
||||
static inline int is_proximity_bomb_or_player_smart_mine_or_placed_mine(const weapon_id_type id)
|
||||
{
|
||||
/* Descent 1 has no smart mines or placed mines. */
|
||||
return id == weapon_id_type::PROXIMITY_ID;
|
||||
|
@ -150,18 +150,18 @@ namespace dsx {
|
|||
// Omega cannon stuff.
|
||||
#define MAX_OMEGA_CHARGE (F1_0) // Maximum charge level for omega cannonw
|
||||
|
||||
static inline int is_proximity_bomb_or_smart_mine(const weapon_id_type id)
|
||||
static inline int is_proximity_bomb_or_player_smart_mine(const weapon_id_type id)
|
||||
{
|
||||
if (id == weapon_id_type::SUPERPROX_ID)
|
||||
return 1;
|
||||
return ::d1x::is_proximity_bomb_or_smart_mine(id);
|
||||
return ::d1x::is_proximity_bomb_or_player_smart_mine(id);
|
||||
}
|
||||
|
||||
static inline int is_proximity_bomb_or_smart_mine_or_placed_mine(const weapon_id_type id)
|
||||
static inline int is_proximity_bomb_or_player_smart_mine_or_placed_mine(const weapon_id_type id)
|
||||
{
|
||||
if (id == weapon_id_type::PMINE_ID)
|
||||
return 1;
|
||||
return is_proximity_bomb_or_smart_mine(id);
|
||||
return is_proximity_bomb_or_player_smart_mine(id);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1201,7 +1201,7 @@ static void collide_player_and_marker(const object_base &playerobj, const vmobjp
|
|||
namespace dsx {
|
||||
static void maybe_kill_weapon(object_base &weapon, const object_base &other_obj)
|
||||
{
|
||||
if (is_proximity_bomb_or_smart_mine_or_placed_mine(get_weapon_id(weapon))) {
|
||||
if (is_proximity_bomb_or_player_smart_mine_or_placed_mine(get_weapon_id(weapon))) {
|
||||
weapon.flags |= OF_SHOULD_BE_DEAD;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ static bool can_collide(const object *const weapon_object, const object_base &it
|
|||
{
|
||||
#if defined(DXX_BUILD_DESCENT_II)
|
||||
case OBJ_WEAPON:
|
||||
return is_proximity_bomb_or_smart_mine_or_placed_mine(get_weapon_id(iter_object));
|
||||
return is_proximity_bomb_or_player_smart_mine_or_placed_mine(get_weapon_id(iter_object));
|
||||
#endif
|
||||
case OBJ_CNTRLCEN:
|
||||
case OBJ_PLAYER:
|
||||
|
@ -186,7 +186,7 @@ static imobjptridx_t object_create_explosion_sub(const d_vclip_array &Vclip, fvm
|
|||
case OBJ_WEAPON:
|
||||
phys_apply_force(obj_iter, vforce);
|
||||
|
||||
if (is_proximity_bomb_or_smart_mine(get_weapon_id(obj_iter)))
|
||||
if (is_proximity_bomb_or_player_smart_mine(get_weapon_id(obj_iter)))
|
||||
{ //prox bombs have chance of blowing up
|
||||
if (fixmul(dist,force) > i2f(8000)) {
|
||||
obj_iter->flags |= OF_SHOULD_BE_DEAD;
|
||||
|
|
|
@ -139,7 +139,7 @@ void Laser_render(grs_canvas &canvas, const object_base &obj)
|
|||
|
||||
static bool ignore_proximity_weapon(const object &o)
|
||||
{
|
||||
if (!is_proximity_bomb_or_smart_mine(get_weapon_id(o)))
|
||||
if (!is_proximity_bomb_or_player_smart_mine(get_weapon_id(o)))
|
||||
return false;
|
||||
#if defined(DXX_BUILD_DESCENT_I)
|
||||
return GameTime64 > o.ctype.laser_info.creation_time + F1_0*2;
|
||||
|
@ -217,7 +217,7 @@ bool laser_are_related(const vcobjptridx_t o1, const vcobjptridx_t o2)
|
|||
auto &o2li = o2->ctype.laser_info;
|
||||
if (o1li.parent_num == o2li.parent_num && o1li.parent_signature == o2li.parent_signature)
|
||||
{
|
||||
if (is_proximity_bomb_or_smart_mine(o1id) || is_proximity_bomb_or_smart_mine(o2id))
|
||||
if (is_proximity_bomb_or_player_smart_mine(o1id) || is_proximity_bomb_or_player_smart_mine(o2id))
|
||||
{
|
||||
// If neither is older than 1/2 second, then can't blow up!
|
||||
#if defined(DXX_BUILD_DESCENT_II)
|
||||
|
@ -906,7 +906,7 @@ imobjptridx_t Laser_create_new(const vms_vector &direction, const vms_vector &po
|
|||
|
||||
// Here's where to fix the problem with objects which are moving backwards imparting higher velocity to their weaponfire.
|
||||
// Find out if moving backwards.
|
||||
if (is_proximity_bomb_or_smart_mine(weapon_type)) {
|
||||
if (is_proximity_bomb_or_player_smart_mine(weapon_type)) {
|
||||
parent_speed = vm_vec_mag_quick(parent->mtype.phys_info.velocity);
|
||||
if (vm_vec_dot(parent->mtype.phys_info.velocity, parent->orient.fvec) < 0)
|
||||
parent_speed = -parent_speed;
|
||||
|
@ -1192,7 +1192,7 @@ imobjptridx_t find_homing_object_complete(const vms_vector &curpos, const vmobjp
|
|||
if ((curobjp->type != track_obj_type1) && (curobjp->type != track_obj_type2))
|
||||
{
|
||||
#if defined(DXX_BUILD_DESCENT_II)
|
||||
if ((curobjp->type == OBJ_WEAPON) && (is_proximity_bomb_or_smart_mine(get_weapon_id(curobjp)))) {
|
||||
if ((curobjp->type == OBJ_WEAPON) && (is_proximity_bomb_or_player_smart_mine(get_weapon_id(curobjp)))) {
|
||||
auto &cur_laser_info = curobjp->ctype.laser_info;
|
||||
auto &tracker_laser_info = tracker->ctype.laser_info;
|
||||
if (cur_laser_info.parent_num != tracker_laser_info.parent_num || cur_laser_info.parent_signature != tracker_laser_info.parent_signature)
|
||||
|
@ -1494,7 +1494,7 @@ static imobjptridx_t Laser_player_fire_spread_delay(fvmsegptridx &vmsegptridx, c
|
|||
// New by MK on 6/8/95, don't let robots evade proximity bombs, thereby decreasing uselessness of bombs.
|
||||
if (obj == ConsoleObject)
|
||||
#if defined(DXX_BUILD_DESCENT_II)
|
||||
if (!is_proximity_bomb_or_smart_mine(get_weapon_id(objnum)))
|
||||
if (!is_proximity_bomb_or_player_smart_mine(get_weapon_id(objnum)))
|
||||
#endif
|
||||
Player_fired_laser_this_frame = objnum;
|
||||
|
||||
|
|
|
@ -2520,7 +2520,7 @@ void multi_send_fire(int laser_gun, int laser_level, int laser_flags, int laser_
|
|||
multibuf[0] = static_cast<char>(MULTI_FIRE);
|
||||
if (is_bomb_objnum != object_none)
|
||||
{
|
||||
if (is_proximity_bomb_or_smart_mine(get_weapon_id(is_bomb_objnum)))
|
||||
if (is_proximity_bomb_or_player_smart_mine(get_weapon_id(is_bomb_objnum)))
|
||||
multibuf[0] = static_cast<char>(MULTI_FIRE_BOMB);
|
||||
}
|
||||
else if (laser_track != object_none)
|
||||
|
|
|
@ -683,9 +683,9 @@ void render_object(grs_canvas &canvas, const d_level_unique_light_state &LevelUn
|
|||
break;
|
||||
|
||||
case RT_WEAPON_VCLIP:
|
||||
if (PlayerCfg.AlphaBlendWeapons && (!is_proximity_bomb_or_smart_mine(get_weapon_id(obj))
|
||||
if (PlayerCfg.AlphaBlendWeapons && (!is_proximity_bomb_or_player_smart_mine(get_weapon_id(obj))
|
||||
#if defined(DXX_BUILD_DESCENT_II)
|
||||
&& get_weapon_id(obj) != ROBOT_SUPERPROX_ID // superprox dropped by robots have their own ID not considered by is_proximity_bomb_or_smart_mine() and since that function is used in many other places, I didn't feel safe to add this weapon type in it
|
||||
&& get_weapon_id(obj) != ROBOT_SUPERPROX_ID // superprox dropped by robots have their own ID not considered by is_proximity_bomb_or_player_smart_mine() and since that function is used in many other places, I didn't feel safe to add this weapon type in it
|
||||
#endif
|
||||
)) // set nice transparency/blending for certain objects
|
||||
{
|
||||
|
@ -2225,7 +2225,7 @@ static unsigned object_is_clearable_weapon(const weapon_info_array &Weapon_info,
|
|||
#endif
|
||||
if (clear_all)
|
||||
return clear_all;
|
||||
return !is_proximity_bomb_or_smart_mine(weapon_id);
|
||||
return !is_proximity_bomb_or_player_smart_mine(weapon_id);
|
||||
}
|
||||
|
||||
//delete objects, such as weapons & explosions, that shouldn't stay between levels
|
||||
|
|
|
@ -447,7 +447,7 @@ window_event_result do_physics_sim(const vmobjptridx_t obj, phys_visited_seglist
|
|||
if (fate == HIT_OBJECT) {
|
||||
auto &objp = *vcobjptr(hit_info.hit_object);
|
||||
|
||||
if ((objp.type == OBJ_WEAPON && is_proximity_bomb_or_smart_mine(get_weapon_id(objp))) ||
|
||||
if ((objp.type == OBJ_WEAPON && is_proximity_bomb_or_player_smart_mine(get_weapon_id(objp))) ||
|
||||
objp.type == OBJ_POWERUP) // do not increase count for powerups since they *should* not change our movement
|
||||
count--;
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ void draw_weapon_vclip(const d_vclip_array &Vclip, const weapon_info_array &Weap
|
|||
const auto play_time = Vclip[vclip_num].play_time;
|
||||
fix modtime = lifeleft % play_time;
|
||||
|
||||
if (is_proximity_bomb_or_smart_mine_or_placed_mine(get_weapon_id(obj)))
|
||||
if (is_proximity_bomb_or_player_smart_mine_or_placed_mine(get_weapon_id(obj)))
|
||||
{ //make prox bombs spin out of sync
|
||||
int objnum = obj;
|
||||
|
||||
|
|
Loading…
Reference in a new issue