Skip to content

Commit d68b18d

Browse files
authored
Upgraded Asteroid Field SEXPs (#6295)
* upgrade asteroid sexps to match new asteroid field features * clang is a needy boy * unify the sexp operators into one since there are minimal changes * cleanup for readability * address feedback
1 parent 40bbced commit d68b18d

File tree

8 files changed

+361
-92
lines changed

8 files changed

+361
-92
lines changed

code/asteroid/asteroid.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ void remove_all_asteroids()
702702
}
703703

704704
// will replace any existing asteroid or debris field with an asteroid field
705-
void asteroid_create_asteroid_field(int num_asteroids, int field_type, int asteroid_speed, bool brown, bool blue, bool orange, vec3d o_min, vec3d o_max, bool inner_box, vec3d i_min, vec3d i_max, SCP_vector<SCP_string> targets)
705+
void asteroid_create_asteroid_field(int num_asteroids, int field_type, int asteroid_speed, vec3d o_min, vec3d o_max, bool inner_box, vec3d i_min, vec3d i_max, SCP_vector<SCP_string> asteroid_types)
706706
{
707707
remove_all_asteroids();
708708

@@ -740,15 +740,7 @@ void asteroid_create_asteroid_field(int num_asteroids, int field_type, int aster
740740

741741
Asteroid_field.field_asteroid_type.clear();
742742

743-
if (brown) {
744-
Asteroid_field.field_asteroid_type.push_back("Brown");
745-
}
746-
if (blue) {
747-
Asteroid_field.field_asteroid_type.push_back("Blue");
748-
}
749-
if (orange) {
750-
Asteroid_field.field_asteroid_type.push_back("Orange");
751-
}
743+
Asteroid_field.field_asteroid_type = std::move(asteroid_types);
752744

753745
Asteroid_field.min_bound = o_min;
754746
Asteroid_field.max_bound = o_max;
@@ -766,8 +758,6 @@ void asteroid_create_asteroid_field(int num_asteroids, int field_type, int aster
766758
Asteroid_field.inner_max_bound = i_max;
767759
}
768760

769-
Asteroid_field.target_names = std::move(targets);
770-
771761
// Only create asteroids if we have some to create
772762
if ((!Asteroid_field.field_asteroid_type.empty()) && (num_asteroids > 0)) {
773763
asteroid_create_all();

code/asteroid/asteroid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ bool asteroid_is_within_view(vec3d *pos, float range, bool range_override = f
163163
void asteroid_level_init();
164164
void asteroid_level_close();
165165
void asteroid_create_all();
166-
void asteroid_create_asteroid_field(int num_asteroids, int field_type, int asteroid_speed, bool brown, bool blue, bool orange, vec3d o_min, vec3d o_max, bool inner_box, vec3d i_min, vec3d i_max, SCP_vector<SCP_string> targets);
166+
void asteroid_create_asteroid_field(int num_asteroids, int field_type, int asteroid_speed, vec3d o_min, vec3d o_max, bool inner_box, vec3d i_min, vec3d i_max, SCP_vector<SCP_string> asteroid_types);
167167
void asteroid_create_debris_field(int num_asteroids, int asteroid_speed, SCP_vector<int> debris_types, vec3d o_min, vec3d o_max, bool enhanced);
168168
void asteroid_render(object* obj, model_draw_list* scene);
169169
void asteroid_delete( object *asteroid_objp );

0 commit comments

Comments
 (0)