Skip to content

Commit

Permalink
Correct HitInfo flags for older clients.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed Aug 15, 2023
1 parent b127d3c commit f7a480a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/game/Objects/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,9 @@ void Unit::CalculateMeleeDamage(Unit* pVictim, uint32 damage, CalcDamageInfo* da
case RANGED_ATTACK:
damageInfo->procAttacker = PROC_FLAG_DEAL_RANGED_ATTACK;
damageInfo->procVictim = PROC_FLAG_TAKE_RANGED_ATTACK;
#if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_9_4
damageInfo->HitInfo = HITINFO_UNK3; // test (dev note: test what? HitInfo flag possibly not confirmed.)
#endif
break;
default:
break;
Expand Down
18 changes: 14 additions & 4 deletions src/game/Objects/UnitDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ enum VictimState

enum HitInfo
{
#if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_9_4
HITINFO_NORMALSWING = 0x00000000,
HITINFO_UNK0 = 0x00000001, // req correct packet structure
HITINFO_AFFECTS_VICTIM = 0x00000002, // no being hit animation on victim without it
Expand All @@ -256,17 +257,26 @@ enum HitInfo
HITINFO_MISS = 0x00000010,
HITINFO_ABSORB = 0x00000020, // plays absorb sound
HITINFO_RESIST = 0x00000040, // resisted atleast some damage
#if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_9_4
HITINFO_CRITICALHIT = 0x00000080,
#else
HITINFO_CRITICALHIT = 0x00000008,
#endif
HITINFO_UNK8 = 0x00000100, // wotlk?
HITINFO_UNK9 = 0x00002000, // wotlk?
HITINFO_GLANCING = 0x00004000,
HITINFO_CRUSHING = 0x00008000,
HITINFO_NOACTION = 0x00010000,
HITINFO_SWINGNOHITSOUND = 0x00080000
#else
HITINFO_NORMALSWING = 0x00000000,
HITINFO_MISS = 0x00000001,
HITINFO_AFFECTS_VICTIM = 0x00000002, // no being hit animation on victim without it
HITINFO_CRITICALHIT = 0x00000008,
HITINFO_LEFTSWING = 0x00000200,
HITINFO_NOACTION = 0x00001000,
HITINFO_ABSORB = 0x00010000, // plays absorb sound
HITINFO_RESIST = 0x00020000, // resisted atleast some damage
HITINFO_GLANCING = 0x00100000,
HITINFO_CRUSHING = 0x00200000,
HITINFO_SWINGNOHITSOUND = 0x00800000
#endif
};

//i would like to remove this: (it is defined in item.h
Expand Down

0 comments on commit f7a480a

Please sign in to comment.