I tried to change
maxValue <<= 1;
to
maxValue <<= 1.2;
and got a few errors
I think i know why it's happening, there's no string to tell my compiler that there's a decimal, but I don't know how to add one as I'm quite the c++ noob.
Any help appreciated.
maxValue <<= 1;
to
maxValue <<= 1.2;
and got a few errors
In member function `virtual int32_t WeaponDistance::getWeaponDamage(const Player*, const Creature*, const Item*, bool) const':
invalid operands of types `int32_t' and `double' to binary `operator<<'
in evaluation of `operator<<=(int32_t, double)'
I think i know why it's happening, there's no string to tell my compiler that there's a decimal, but I don't know how to add one as I'm quite the c++ noob.
Any help appreciated.
Code:
int32_t WeaponDistance::getWeaponDamage(const Player* player, const Creature* target, const Item* item, bool maxDamage /*= false*/) const
{
int32_t attackValue = ammuAttackValue;
if(item->getWeaponType() == WEAPON_AMMO){
Item* bow = const_cast<Player*>(player)->getWeapon(true);
if(bow){
attackValue += bow->getAttack();
}
}
int32_t attackSkill = player->getSkill(SKILL_DIST, SKILL_LEVEL);
float attackFactor = player->getAttackFactor();
int32_t maxValue = Weapons::getMaxDistanceWeaponDamage(attackSkill, attackValue, attackFactor);
if(random_range(1, 100) <= g_config.getNumber(ConfigManager::CRITICAL_HIT_CHANCE))
{
maxValue <<= 1.2;
player->sendCriticalHit();
}