我遇到了编译代码的问题,以下是我的错误信息:
警告 C4018: '>=' : signed/unsigned mismatch
警告 C4018: '>=' : signed/unsigned mismatch
void Player::HasteCap()
{
if (sWorld->getBoolConfig(CONFIG_PLAYER_HASTECAP_ENABLE))
return;
bool hasInstantHasteCap = (GetFloatValue(UNIT_FIELD_BASEATTACKTIME + 0) == 1
|| GetFloatValue(UNIT_FIELD_BASEATTACKTIME + 1) == 1
|| GetFloatValue(UNIT_FIELD_BASEATTACKTIME + 2) == 1
|| GetFloatValue(UNIT_MOD_CAST_SPEED) == 0);
if (m_baseRatingValue[CR_HASTE_MELEE] > sWorld->getIntConfig(CONFIG_PLAYER_HASTECAP_LIMIT))
{
SetFloatValue(UNIT_MOD_CAST_SPEED, 0);
SetFloatValue(UNIT_FIELD_BASEATTACKTIME + BASE_ATTACK, 1);
SetFloatValue(UNIT_FIELD_BASEATTACKTIME + OFF_ATTACK, 1);
SetFloatValue(UNIT_FIELD_BASEATTACKTIME + RANGED_ATTACK, 1);
}
else if (hasInstantHasteCap && m_baseRatingValue[CR_HASTE_MELEE] < sWorld->getIntConfig(CONFIG_PLAYER_HASTECAP_LIMIT))
{
SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f);
SetRegularAttackTime();
ApplyCastTimePercentMod(m_baseRatingValue[CR_HASTE_SPELL] * GetRatingMultiplier(CR_HASTE_SPELL), true);
if (GetShapeshiftForm())
{
SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(GetShapeshiftForm());
if (ssEntry && ssEntry->attackSpeed)
{
SetAttackTime(BASE_ATTACK, ssEntry->attackSpeed);
SetAttackTime(OFF_ATTACK, ssEntry->attackSpeed);
SetAttackTime(RANGED_ATTACK, BASE_ATTACK_TIME);
}
}
}
if (CanModifyStats())
{
UpdateDamagePhysical(BASE_ATTACK);
UpdateDamagePhysical(OFF_ATTACK);
UpdateDamagePhysical(RANGED_ATTACK);
}
}