Skip to content

Monster projectile damage is applied to the current AttackTarget instead of the creature the projectile hit #4504

Description

@jakerange52

Monster projectiles lock ProjectileTarget at launch, but damage is applied to the monster's current AttackTarget. I.e. if the monster shoots a non-player (this behavior can happen with combat pet, other player, or creature) and retargets a player before collision, the projectile hits the creature then CalculateDamage uses that creature's armor and (if it was a non-player) never sets BodyPart. TakeDamage then subtracts that amount from the player. Survivors log bad damage location with body part 0 (instant kills skip this log)

Also means when missile mobs bounce targets between players, players may take eachothers calculated damage.

The flow of the logic:

  1. In Creature_Missile the projectile target is set in LaunchProjectile().
  2. In ProjectileCollisionHelper, OnCollideObject() targetPlayer is assigned in this collision method as the sourceCreature.AttackTarget in real time.
  3. DoCalculateDamage() is passed the correct values for the intended target (targetCreature) at time of launch.
  4. TakeDamage() is invoked on targetPlayer using the damageEvent from targetCreature.

2026-09-28 15:53:00,928 [World Manager] WARN (ACE.Server.WorldObjects.Player) +Frts.TakeDamage(Mu-miyah Huntress, Pierce, 379, 0, False): avoided crash for bad damage location

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions