Skip to content

Commit 61b3d82

Browse files
authored
make particle curves respect weapon curves (scp-fs2open#6728)
1 parent 5ca6421 commit 61b3d82

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

code/particle/hosts/EffectHostObject.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,15 @@ std::pair<int, int> EffectHostObject::getParentObjAndSig() const {
5656
}
5757

5858
float EffectHostObject::getHostRadius() const {
59-
return Objects[m_objnum].radius;
59+
auto objp = &Objects[m_objnum];
60+
if (objp->type == OBJ_WEAPON) {
61+
auto wp = &Weapons[objp->instance];
62+
auto wip = &Weapon_info[wp->weapon_info_index];
63+
if (wip->render_type == WRT_LASER) {
64+
return objp->radius * wip->weapon_curves.get_output(weapon_info::WeaponCurveOutputs::LASER_RADIUS_MULT, *wp, &wp->modular_curves_instance);
65+
}
66+
}
67+
return objp->radius;
6068
}
6169

6270
bool EffectHostObject::isValid() const {

0 commit comments

Comments
 (0)