tModLoader / tModLoader

A mod to make and play Terraria mods. Supports Terraria 1.4 (and earlier) installations
https://www.tmodloader.net/
MIT License
4.19k stars 1.88k forks source link

Damage Calculation Error - All DamageClasses bonuses are applied to Melee Calculations #2521

Closed EzequielDM closed 2 years ago

EzequielDM commented 2 years ago

Version

Latest 1.4-stable

OS

Windows

Platform

Steam

This bug affects

Gameplay as a Player

Description

Every sort of damage bonus applied, be it DamageClass.Magic, DamageClass.Summon or others change the damage of melee weapons.

Behavior is only present on TModLoader and doesn't happen on normal Terraria.

In-Game Screenshot

(No buffs, no mods [except for CheatSheet on this screenshot but it was tested without and the behavior persists])

Log File

client.log (probably not needed)

Steps to reproduce

  1. Create a new character
  2. Add in Papyrus Scarab, Summoner Emblem, Celestial Emblem and any other class specific damage bonus accessories
  3. Equip them
  4. Watch the melee damage of any weapon change as you equip and unequip them

Expected Behavior

I think the description of expected behavior is not needed.

Actual Behavior

magicDamage += 0.2f should not change meleeDamage at all, but for some reason it is on TModLoader.

Reproduction frequency

Consistent.

Additional Information

I'm pretty sure this has to do with the new patches for Player#GetDamage(DamageClass damageClass) or Player#GetWeaponDamage(Item sItem, [bool forTooltip = false])

Jofairden commented 2 years ago

This seems like an odd one. My first thought is that this is probably some kind of reference error Tagging @Chicken-Bones and @Mirsario

Chicken-Bones commented 2 years ago

Fixed in #2523