Minion ModifyWeaponDamage Patch

Minion ModifyWeaponDamage Patch

Minion ModifyWeaponDamage Patch for tModLoader

Discover a crucial fix for summoners and mod creators in tModLoader. This mod addresses a specific bug within the tModLoader framework that impacts how minion, sentry, and projectile damage is calculated when modified by other mods.

Understanding the Issue

When using mods that interact with the ModifyWeaponDamage hook in tModLoader, a bug can cause minions, sentries, and other projectiles that continuously update their damage to not properly scale with these modifications. This means the damage output of your summoned allies might not reflect the buffs and changes intended by other mods you have installed.

How the Patch Works

The Minion ModifyWeaponDamage Patch acts as a workaround for this tModLoader bug. It intercepts the damage calculation process for affected projectiles. By identifying the parent player and weapon, it correctly applies the damage modifications from the ModifyWeaponDamage hook. The mod then uses the PreAI hook to ensure that projectile damage is updated in real-time, incorporating the saved modifications. This process is managed within a GlobalProjectile class, ensuring broad compatibility.

Key Features

  • Fixes a tModLoader bug affecting minion, sentry, and projectile damage scaling.
  • Ensures continuous damage updates are properly applied from ModifyWeaponDamage hook.
  • Designed for compatibility with multiplayer and most other mods.
  • Open-source code available for modders to inspect or integrate.

For Players and Modders

For Players: If you primarily play as a summoner and suspect your minion damage isn’t scaling correctly with other mods, simply subscribe to and enable this mod. It will automatically work in the background to resolve the issue. You may find this mod particularly useful if you encounter inconsistent damage output from your summoned companions.

For Modders: If your mod utilizes the ModifyWeaponDamage hook, it’s recommended to test the damage calculations for minions, sentries, and continuously updating projectiles. This patch may resolve compatibility issues you’re experiencing. The source code is accessible for you to learn from or even copy directly if you prefer, though a public repository is not maintained.

Important Considerations

It’s important to note that this patch operates as a workaround. Like older methods of damage scaling, it can “snapshot” damage boosts from ModifyWeaponDamage when minions or sentries are summoned. This means if ModifyWeaponDamage is used dynamically, damage benefits might not update without re-summoning your allies. While effective, this workaround is a solution for a complex tModLoader issue that is unlikely to be patched directly due to its intricacies.

Leave a Reply