From 85ede9cf6bd31fe48eec29ef75ea7d00ba93a244 Mon Sep 17 00:00:00 2001 From: Goober5000 Date: Mon, 5 Oct 2026 16:51:17 -0400 Subject: [PATCH] let a dinky shockwave use its own radius curve The radius curve was always read from the weapon's regular shockwave, so a curve specified under $Dinky shockwave: had no effect. Store the curve on the shockwave itself. Co-Authored-By: Claude Fable 5.1 --- code/weapon/shockwave.cpp | 5 +++-- code/weapon/shockwave.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/weapon/shockwave.cpp b/code/weapon/shockwave.cpp index ec75394bfcd..d30bde36a53 100644 --- a/code/weapon/shockwave.cpp +++ b/code/weapon/shockwave.cpp @@ -143,6 +143,7 @@ int shockwave_create(int parent_objnum, const vec3d* pos, const shockwave_create sw->inner_radius = sci->inner_rad; sw->outer_radius = sci->outer_rad; sw->damage = sci->damage; + sw->radius_curve_idx = sci->radius_curve_idx; sw->blast = sci->blast; sw->radius = 1.0f; sw->pos = *pos; @@ -299,8 +300,8 @@ void shockwave_move(object *shockwave_objp, float frametime) if (sw->weapon_info_index >= 0) wip = &Weapon_info[sw->weapon_info_index]; - if (wip && wip->shockwave.radius_curve_idx >= 0) { - float val = Curves[wip->shockwave.radius_curve_idx].GetValue(sw->time_elapsed / sw->total_time); + if (sw->radius_curve_idx >= 0) { + float val = Curves[sw->radius_curve_idx].GetValue(sw->time_elapsed / sw->total_time); sw->radius = val * sw->outer_radius; if (sw->radius < 0.0f) sw->radius = 0.0f; diff --git a/code/weapon/shockwave.h b/code/weapon/shockwave.h index 194c492b551..f9b5d434e5f 100644 --- a/code/weapon/shockwave.h +++ b/code/weapon/shockwave.h @@ -55,6 +55,7 @@ typedef struct shockwave { SCP_vector> obj_sig_hitlist; float speed, radius; float inner_radius, outer_radius, damage; + int radius_curve_idx; // curve for radius over time, or -1 to expand at a constant speed int weapon_info_index; // -1 if shockwave not caused by weapon int damage_type_idx; //What type of damage this shockwave does to armor vec3d pos;