Merge pull request #14 from vyuuui/cweapon

Match CWeapon::Think
This commit is contained in:
Henrique Gemignani Passos Lima 2022-11-11 20:04:10 +02:00 committed by GitHub
commit ae223047e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -35,6 +35,16 @@ public:
, x14_knockback(knockback) , x14_knockback(knockback)
, x18_24_noImmunity(noImmunity) {} , x18_24_noImmunity(noImmunity) {}
// HACK: This constructor exists to fix CWeapon::Think writing xc_radiusDamage as a double
CDamageInfo(const CWeaponMode& mode, float damage, float radiusDamage, float radius, float knockback,
bool noImmunity = false)
: x0_weaponMode(mode)
, x8_damage(damage)
, xc_radiusDamage(radiusDamage)
, x10_radius(radius)
, x14_knockback(knockback)
, x18_24_noImmunity(noImmunity) {}
CDamageInfo(CInputStream& in); CDamageInfo(CInputStream& in);
CDamageInfo(const CDamageInfo&, float); CDamageInfo(const CDamageInfo&, float);
CDamageInfo(const SShotParam& other); CDamageInfo(const SShotParam& other);

View File

@ -41,7 +41,7 @@ void CWeapon::Think(float dt, CStateManager& mgr) {
float radius = scale * x110_origDamageInfo.GetRadius(); float radius = scale * x110_origDamageInfo.GetRadius();
float knockback = scale * x110_origDamageInfo.GetKnockBackPower(); float knockback = scale * x110_origDamageInfo.GetKnockBackPower();
x12c_curDamageInfo = x12c_curDamageInfo =
CDamageInfo(x110_origDamageInfo.GetWeaponMode(), damage, radius, knockback); CDamageInfo(x110_origDamageInfo.GetWeaponMode(), damage, (double)(scale * x110_origDamageInfo.GetDamage()), radius, knockback);
} else { } else {
x12c_curDamageInfo = x110_origDamageInfo; x12c_curDamageInfo = x110_origDamageInfo;
} }