@@ -819,11 +819,7 @@ void parse_shockwave_info(shockwave_create_info *sci, const char *pre_char)
819819
820820 sprintf (buf, " %sShockwave Radius Multiplier over Lifetime Curve:" , pre_char);
821821 if (optional_string (buf.c_str ())) {
822- SCP_string curve_name;
823- stuff_string (curve_name, F_NAME );
824- sci->radius_curve_idx = curve_get_by_name (curve_name);
825- if (sci->radius_curve_idx < 0 )
826- Warning (LOCATION , " Unrecognized shockwave radius curve '%s'" , curve_name.c_str ());
822+ sci->radius_curve_idx = curve_parse (" Shockwave will not use a curve." );
827823 }
828824
829825 sprintf (buf, " %sShockwave Speed:" , pre_char);
@@ -1233,9 +1229,7 @@ int parse_weapon(int subtype, bool replace, const char *filename)
12331229 }
12341230
12351231 if (optional_string (" @Laser Length Multiplier over Lifetime Curve:" )) {
1236- SCP_string curve_name;
1237- stuff_string (curve_name, F_NAME );
1238- wip->weapon_curves .add_curve (" Lifetime" , weapon_info::WeaponCurveOutputs::LASER_LENGTH_MULT , modular_curves_entry{curve_get_by_name (curve_name)});
1232+ wip->weapon_curves .add_curve (" Lifetime" , weapon_info::WeaponCurveOutputs::LASER_LENGTH_MULT , modular_curves_entry{curve_parse (" Laser Length will not be modified." )});
12391233 }
12401234
12411235 if (optional_string (" @Laser Head Radius:" )) {
@@ -1247,9 +1241,7 @@ int parse_weapon(int subtype, bool replace, const char *filename)
12471241 }
12481242
12491243 if (optional_string (" @Laser Radius Multiplier over Lifetime Curve:" )) {
1250- SCP_string curve_name;
1251- stuff_string (curve_name, F_NAME );
1252- wip->weapon_curves .add_curve (" Lifetime" , weapon_info::WeaponCurveOutputs::LASER_RADIUS_MULT , modular_curves_entry{curve_get_by_name (curve_name)});
1244+ wip->weapon_curves .add_curve (" Lifetime" , weapon_info::WeaponCurveOutputs::LASER_RADIUS_MULT , modular_curves_entry{curve_parse (" Laser Radius will not be modified." )});
12531245 }
12541246 if (optional_string (" @Laser Glow Length Scale:" )) {
12551247 stuff_float (&wip->laser_glow_length_scale );
@@ -1270,9 +1262,7 @@ int parse_weapon(int subtype, bool replace, const char *filename)
12701262 parse_optional_float_into (" @Laser Min Pixel Size:" , &wip->laser_min_pixel_size );
12711263
12721264 if (optional_string (" @Laser Opacity over Lifetime Curve:" )) {
1273- SCP_string curve_name;
1274- stuff_string (curve_name, F_NAME );
1275- wip->weapon_curves .add_curve (" Lifetime" , weapon_info::WeaponCurveOutputs::LASER_ALPHA_MULT , modular_curves_entry{curve_get_by_name (curve_name)});
1265+ wip->weapon_curves .add_curve (" Lifetime" , weapon_info::WeaponCurveOutputs::LASER_ALPHA_MULT , modular_curves_entry{curve_parse (" Laser Opacity will not be modified." )});
12761266 }
12771267
12781268 if (parse_optional_color3i_into (" $Light color:" , &wip->light_color )) {
@@ -1363,13 +1353,7 @@ int parse_weapon(int subtype, bool replace, const char *filename)
13631353
13641354 if (optional_string (" $Damage Multiplier over Lifetime Curve:" )) {
13651355 // Legacy table. Just populates the modular curve set!
1366- SCP_string curve_name;
1367- stuff_string (curve_name, F_NAME );
1368- int curve = curve_get_by_name (curve_name);
1369- if (curve < 0 )
1370- Warning (LOCATION , " Unrecognized damage curve '%s' for weapon %s" , curve_name.c_str (), wip->name );
1371-
1372- damage_mult_curve.emplace (modular_curves_entry{curve});
1356+ damage_mult_curve.emplace (modular_curves_entry{curve_parse (" Weapon Damage will not be modified." )});
13731357 }
13741358
13751359 if (optional_string (" $Damage Type:" )) {
@@ -1601,9 +1585,7 @@ int parse_weapon(int subtype, bool replace, const char *filename)
16011585 }
16021586
16031587 if (optional_string (" +Turn Rate Multiplier over Lifetime Curve:" )) {
1604- SCP_string curve_name;
1605- stuff_string (curve_name, F_NAME );
1606- wip->weapon_curves .add_curve (" Lifetime" , weapon_info::WeaponCurveOutputs::TURN_RATE_MULT , modular_curves_entry{curve_get_by_name (curve_name)});
1588+ wip->weapon_curves .add_curve (" Lifetime" , weapon_info::WeaponCurveOutputs::TURN_RATE_MULT , modular_curves_entry{curve_parse (" Turn Rate will not be modified." )});
16071589 }
16081590
16091591 if (optional_string (" +View Cone:" )) {
@@ -1660,9 +1642,7 @@ int parse_weapon(int subtype, bool replace, const char *filename)
16601642 }
16611643
16621644 if (optional_string (" +Turn Rate Multiplier over Lifetime Curve:" )) {
1663- SCP_string curve_name;
1664- stuff_string (curve_name, F_NAME );
1665- wip->weapon_curves .add_curve (" Lifetime" , weapon_info::WeaponCurveOutputs::TURN_RATE_MULT , modular_curves_entry{curve_get_by_name (curve_name)});
1645+ wip->weapon_curves .add_curve (" Lifetime" , weapon_info::WeaponCurveOutputs::TURN_RATE_MULT , modular_curves_entry{curve_parse (" Turn Rate will not be modified." )});
16661646 }
16671647
16681648 if (optional_string (" +View Cone:" )) {
@@ -2989,9 +2969,7 @@ int parse_weapon(int subtype, bool replace, const char *filename)
29892969 }
29902970
29912971 if (optional_string (" +Opacity over Lifetime Curve:" )) {
2992- SCP_string curve_name;
2993- stuff_string (curve_name, F_NAME );
2994- wip->beam_curves .add_curve (" Beam Lifetime" , weapon_info::BeamCurveOutputs::BEAM_ALPHA_MULT , modular_curves_entry{curve_get_by_name (curve_name)});
2972+ wip->beam_curves .add_curve (" Beam Lifetime" , weapon_info::BeamCurveOutputs::BEAM_ALPHA_MULT , modular_curves_entry{curve_parse (" Beam Lifetime will not be modified." )});
29952973 }
29962974
29972975 // # of shots (only used for type D beams)
@@ -3289,13 +3267,9 @@ int parse_weapon(int subtype, bool replace, const char *filename)
32893267 }
32903268
32913269 if (optional_string (" +Slash position over beam lifetime curve:" )) {
3292- SCP_string curve_name;
3293- stuff_string (curve_name, F_NAME );
3294- t5info->slash_pos_curve_idx = curve_get_by_name (curve_name);
3295- if (t5info->slash_pos_curve_idx < 0 )
3296- Warning (LOCATION , " Unrecognized slash position curve '%s' for weapon %s" , curve_name.c_str (), wip->name );
3270+ t5info->slash_pos_curve_idx = curve_parse (" Slash Position will not be modified." );
32973271 if (t5info->no_translate )
3298- Warning ( LOCATION , " Beam weapon %s has a slash position curve defined, but doesn't slash!" , wip->name );
3272+ error_display ( 0 , " Beam weapon %s has a slash position curve defined, but doesn't slash!" , wip->name );
32993273 }
33003274
33013275 if (optional_string (" +Orient Offsets to Target:" )) {
@@ -3312,11 +3286,7 @@ int parse_weapon(int subtype, bool replace, const char *filename)
33123286 }
33133287
33143288 if (optional_string (" +Rotation over beam lifetime curve:" )) {
3315- SCP_string curve_name;
3316- stuff_string (curve_name, F_NAME );
3317- t5info->rot_curve_idx = curve_get_by_name (curve_name);
3318- if (t5info->rot_curve_idx < 0 )
3319- Warning (LOCATION , " Unrecognized rotation curve '%s' for weapon %s" , curve_name.c_str (), wip->name );
3289+ t5info->rot_curve_idx = curve_parse (" Beam Rotation will not be modified." );
33203290 }
33213291
33223292 if (optional_string (" +Continuous Rotation Axis:" )) {
0 commit comments