chucky91
Veteran OT User
I have this problem when compiling, despite compiling but the character does not save in the database when relogin.
I had a problem with player.cpp but i solved it now, i just need this one and i haven't found a solution.
Does anyone have any idea what it is? or is a library missing?

src\combat.cpp(1036,25): warning C4018: '<=': signed/unsigned mismatch
src\combat.cpp(1242,72): warning C4018: '<': signed/unsigned mismatch
src\condition.cpp(759,7): warning C4189: 'ret': local variable is initialized but not referenced
I had a problem with player.cpp but i solved it now, i just need this one and i haven't found a solution.
Does anyone have any idea what it is? or is a library missing?

src\combat.cpp(1036,25): warning C4018: '<=': signed/unsigned mismatch
C++:
int32_t distance = std::max<uint32_t>(Position::getDistanceX(attackerPos, targetPos), Position::getDistanceY(attackerPos, targetPos));
if (distance <= 1) {
distance = 5;
}
distance *= 15;
bool hit = false;
if (rand() % distance <= skillValue) { //<----------
hit = rand() % 100 <= hitChance;
}
if (Player* player = attacker->getPlayer()) {
if (player->getAddAttackSkill()) {
switch (player->getLastAttackBlockType()) {
case BLOCK_NONE: {
player->addSkillAdvance(SKILL_DISTANCE, 2);
break;
}
case BLOCK_DEFENSE:
case BLOCK_ARMOR: {
player->addSkillAdvance(SKILL_DISTANCE, 1);
break;
}
default: break;
}
}
}
src\combat.cpp(1242,72): warning C4018: '<': signed/unsigned mismatch
C++:
bool Combat::canUseWeapon(Player* player, Item* weapon)
{
if (player->hasFlag(PlayerFlag_IgnoreWeaponCheck)) {
return true;
}
if (player->getLevel() < weapon->getMinimumLevel()) {
return false;
}
//----------v
if (!player->hasFlag(PlayerFlag_HasInfiniteMana) && player->getMana() < weapon->getManaConsumption()) {
return false;
}
const ItemType& itemType = Item::items[weapon->getID()];
if (hasBitSet(WIELDINFO_VOCREQ, itemType.wieldInfo)) {
if (!hasBitSet(player->getVocationFlagId(), itemType.vocations)) {
return false;
}
}
return true;
}
src\condition.cpp(759,7): warning C4189: 'ret': local variable is initialized but not referenced
C++:
bool ConditionDamage::setParam(ConditionParam_t param, int32_t value)
{
bool ret = Condition::setParam(param, value); //<----------
switch (param) {
case CONDITION_PARAM_OWNER:
owner = value;
return true;
case CONDITION_PARAM_CYCLE:
cycle = value;
return true;
case CONDITION_PARAM_COUNT:
count = value;
return true;
case CONDITION_PARAM_MAX_COUNT:
max_count = value;
return true;
case CONDITION_PARAM_HIT_DAMAGE:
hit_damage = value;
return true;
default:
return false;
}
}
Last edited: