File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -5821,7 +5821,7 @@ void ship::clear()
58215821 target_shields_delta = 0.0f;
58225822 target_weapon_energy_delta = 0.0f;
58235823
5824- weapons = ship_weapon ();
5824+ weapons.clear ();
58255825
58265826 // ---------- special weapons init that isn't setting things to 0
58275827 for (i = 0; i < MAX_SHIP_PRIMARY_BANKS; i++)
@@ -5993,7 +5993,7 @@ void ship::clear()
59935993 autoaim_fov = 0.0f;
59945994}
59955995
5996- ship_weapon::ship_weapon ()
5996+ void ship_weapon::clear ()
59975997{
59985998 flags.reset();
59995999
@@ -6076,6 +6076,10 @@ ship_weapon::ship_weapon()
60766076 last_fired_weapon_signature = -1;
60776077}
60786078
6079+ ship_weapon::ship_weapon() {
6080+ clear();
6081+ }
6082+
60796083// NOTE: Now that the clear() member function exists, this function only sets the stuff associated with the object and ship class.
60806084void ship_set(int ship_index, int objnum, int ship_type)
60816085{
@@ -6421,7 +6425,7 @@ void ship_subsys::clear()
64216425 awacs_intensity = 0.0f;
64226426 awacs_radius = 0.0f;
64236427
6424- weapons = ship_weapon ();
6428+ weapons.clear ();
64256429
64266430 memset(&submodel_info_1, 0, sizeof(submodel_instance_info));
64276431 memset(&submodel_info_2, 0, sizeof(submodel_instance_info));
Original file line number Diff line number Diff line change @@ -158,7 +158,15 @@ class ship_weapon {
158158 size_t primary_bank_pattern_index[MAX_SHIP_PRIMARY_BANKS];
159159 size_t secondary_bank_pattern_index[MAX_SHIP_SECONDARY_BANKS];
160160
161+ /* *
162+ * @brief Constructor. Calls clear()
163+ */
161164 ship_weapon ();
165+
166+ /* *
167+ * @brief Inits ship_weapon
168+ */
169+ void clear ();
162170};
163171
164172// **************************************************************
You can’t perform that action at this time.
0 commit comments