secondlife
Active Member
- Joined
- Aug 1, 2009
- Messages
- 302
- Reaction score
- 25
hi people, i have a problem with tfs 0.4.
Paladins they do not cause damage in players/monsters at same sqm (only effect poof). how can i solve this problem?
Melee (knights) attack works correctly.
I think it has to do with the distance from the target.
I find this codes in weapons.cpp, Does it have anything to do with it?
Many thanks to anyone who can help-me with this issue, hugs!
Paladins they do not cause damage in players/monsters at same sqm (only effect poof). how can i solve this problem?
Melee (knights) attack works correctly.
I think it has to do with the distance from the target.
I find this codes in weapons.cpp, Does it have anything to do with it?
Code:
if(item->getWeaponType() == WEAPON_AMMO)
{
Item* bow = player->getWeapon(true);
if(bow && bow->getHitChance() != -1)
chance += bow->getHitChance();
}
if(random_range(1, 100) > chance)
{
//we failed attack, miss!
Tile* destTile = target->getTile();
if(!Position::areInRange<1,1,0>(player->getPosition(), target->getPosition()))
{
std::vector<std::pair<int32_t, int32_t> > destList;
destList.push_back(std::make_pair(-1, 1));
std::random_shuffle(destList.begin(), destList.end());
Position destPos = target->getPosition();
Tile* tmpTile = NULL;
for(std::vector<std::pair<int32_t, int32_t> >::iterator it = destList.begin(); it != destList.end(); ++it)
{
if((tmpTile = g_game.getTile(destPos.x + it->first, destPos.y + it->second, destPos.z))
&& !tmpTile->hasProperty(IMMOVABLEBLOCKSOLID) && tmpTile->ground)
{
destTile = tmpTile;
break;
}
}
}
Weapon::internalUseWeapon(player, item, destTile);
}
else
Weapon::internalUseWeapon(player, item, target, damageModifier);
return true;
}
Many thanks to anyone who can help-me with this issue, hugs!