Skip to content

Commit 9119837

Browse files
committed
some variable cleanup
1 parent eaf66e5 commit 9119837

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

code/prop/prop.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ int prop_name_lookup(const char *name)
5454
Assertion(name != nullptr, "NULL name passed to prop_name_lookup");
5555

5656
for (size_t i=0; i < Props.size(); i++){
57-
auto prop = Props[i] ? &Props[i].value() : nullptr;
58-
if (prop == nullptr) {
57+
auto p = Props[i] ? &Props[i].value() : nullptr;
58+
if (p == nullptr) {
5959
continue;
6060
}
61-
if (prop->objnum >= 0){
62-
if (Objects[prop->objnum].type == OBJ_PROP) {
63-
if (!stricmp(name, prop->prop_name)) {
61+
if (p->objnum >= 0){
62+
if (Objects[p->objnum].type == OBJ_PROP) {
63+
if (!stricmp(name, p->prop_name)) {
6464
return static_cast<int>(i);
6565
}
6666
}

code/ship/shipfx.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -829,17 +829,17 @@ bool shipfx_eye_in_shadow( vec3d *eye_pos, object * src_obj, int light_n )
829829
}
830830
}
831831

832-
for (const auto& prop : Props) {
833-
if (prop.has_value()) {
834-
objp = &Objects[prop->objnum];
832+
for (const auto& p : Props) {
833+
if (p.has_value()) {
834+
objp = &Objects[p->objnum];
835835
if (objp->flags[Object::Object_Flags::Should_be_dead])
836836
continue;
837837

838838
if (src_obj != objp) {
839839
vm_vec_scale_add(&rp1, &rp0, &light_dir, objp->radius * 10.0f);
840840

841-
mc.model_instance_num = prop->model_instance_num;
842-
mc.model_num = Prop_info[prop->prop_info_index].model_num;
841+
mc.model_instance_num = p->model_instance_num;
842+
mc.model_num = Prop_info[p->prop_info_index].model_num;
843843
mc.orient = &objp->orient;
844844
mc.pos = &objp->pos;
845845
mc.p0 = &rp0;

code/weapon/beam.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3354,7 +3354,6 @@ int beam_collide_prop(obj_pair* pair)
33543354
beam* a_beam;
33553355
object* weapon_objp;
33563356
object* prop_objp;
3357-
weapon_info* bwi;
33583357
mc_info mc;
33593358
int model_num;
33603359
float width;
@@ -3403,8 +3402,6 @@ int beam_collide_prop(obj_pair* pair)
34033402
prop_objp = pair->b;
34043403
prop* propp = prop_id_lookup(prop_objp->instance);
34053404

3406-
bwi = &Weapon_info[a_beam->weapon_info_index];
3407-
34083405
// get the width of the beam
34093406
width = a_beam->beam_collide_width * a_beam->current_width_factor;
34103407

0 commit comments

Comments
 (0)