mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-08 15:33:53 +00:00
Fix for error introduced in projectile update for throwing/archery
to do hit chance check 2x resulting in much greater chance to miss.
This commit is contained in:
parent
24ea7a0d45
commit
70dd447156
@ -828,6 +828,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
||||
this function is then run again to do the damage portion
|
||||
*/
|
||||
bool LaunchProjectile = false;
|
||||
bool ProjectileImpact = false;
|
||||
bool ProjectileMiss = false;
|
||||
|
||||
if (RuleB(Combat, ProjectileDmgOnImpact)){
|
||||
@ -844,6 +845,8 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
||||
|
||||
if (!RangeWeapon && !Ammo && range_id && ammo_id){
|
||||
|
||||
ProjectileImpact = true;
|
||||
|
||||
if (weapon_damage == 0)
|
||||
ProjectileMiss = true; //This indicates that MISS was originally calculated.
|
||||
|
||||
@ -865,7 +868,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
||||
else if (AmmoItem)
|
||||
SendItemAnimation(other, AmmoItem, SkillArchery);
|
||||
|
||||
if (ProjectileMiss || !other->CheckHitChance(this, SkillArchery, MainPrimary, chance_mod)) {
|
||||
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillArchery, MainPrimary, chance_mod))) {
|
||||
mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName());
|
||||
|
||||
if (LaunchProjectile){
|
||||
@ -1382,6 +1385,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
||||
this function is then run again to do the damage portion
|
||||
*/
|
||||
bool LaunchProjectile = false;
|
||||
bool ProjectileImpact = false;
|
||||
bool ProjectileMiss = false;
|
||||
|
||||
if (RuleB(Combat, ProjectileDmgOnImpact)){
|
||||
@ -1391,6 +1395,8 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
||||
else{
|
||||
if (!RangeWeapon && range_id){
|
||||
|
||||
ProjectileImpact = true;
|
||||
|
||||
if (weapon_damage == 0)
|
||||
ProjectileMiss = true; //This indicates that MISS was originally calculated.
|
||||
|
||||
@ -1408,7 +1414,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
||||
else if (AmmoItem)
|
||||
SendItemAnimation(other, AmmoItem, SkillThrowing);
|
||||
|
||||
if (ProjectileMiss || !other->CheckHitChance(this, SkillThrowing, MainPrimary, chance_mod)){
|
||||
if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillThrowing, MainPrimary, chance_mod))){
|
||||
mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName());
|
||||
if (LaunchProjectile){
|
||||
TryProjectileAttack(other, AmmoItem, SkillThrowing, 0, RangeWeapon, nullptr, AmmoSlot, speed);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user