potential crash issue involving backstab & missing primary weapons resolved.

This commit is contained in:
SecretsOTheP 2014-02-16 19:16:18 -05:00
parent 1ebf88abbb
commit 88eb0dcdfc
2 changed files with 9 additions and 8 deletions

View File

@ -145,7 +145,6 @@ void EQStreamFactory::ReaderLoop()
{
fd_set readset;
std::map<std::pair<uint32, uint16>,EQStream *>::iterator stream_itr;
EQStream* currStream = NULL;
int num;
int length;
unsigned char buffer[2048];

View File

@ -606,14 +606,16 @@ void Mob::RogueBackstab(Mob* other, bool min_damage, int ReuseTime)
if(IsClient()){
const ItemInst *wpn = nullptr;
wpn = CastToClient()->GetInv().GetItem(SLOT_PRIMARY);
primaryweapondamage = GetWeaponDamage(other, wpn);
backstab_dmg = wpn->GetItem()->BackstabDmg;
for(int i = 0; i < MAX_AUGMENT_SLOTS; ++i)
{
ItemInst *aug = wpn->GetAugment(i);
if(aug)
if(wpn) {
primaryweapondamage = GetWeaponDamage(other, wpn);
backstab_dmg = wpn->GetItem()->BackstabDmg;
for(int i = 0; i < MAX_AUGMENT_SLOTS; ++i)
{
backstab_dmg += aug->GetItem()->BackstabDmg;
ItemInst *aug = wpn->GetAugment(i);
if(aug)
{
backstab_dmg += aug->GetItem()->BackstabDmg;
}
}
}
}