diff --git a/source/src/bot/bot_ai.cpp b/source/src/bot/bot_ai.cpp index 28ce2100..1ac9f464 100644 --- a/source/src/bot/bot_ai.cpp +++ b/source/src/bot/bot_ai.cpp @@ -48,7 +48,6 @@ vec CBot::GetEnemyPos(dynent *d) if (m_pBotSkill->bCanPredict) { // How higher the skill, how further the bot predicts - vec org = o; float flPredictTime = RandomFloat(1.25f, 1.7f) / (m_sSkillNr+1); o = PredictPos(o, d->vel, flPredictTime); } @@ -58,18 +57,17 @@ vec CBot::GetEnemyPos(dynent *d) if (m_pBotSkill->bCanPredict) { // How higher the skill, how 'more' the bot predicts - vec org = o; float flPredictTime = RandomFloat(0.8f, 1.2f) / (m_sSkillNr+1); o = PredictPos(o, d->vel, flPredictTime); } } if (flDist > 60.0f) - flScale = 1.0; + flScale = 1.0f; else if (flDist > 6.0f) - flScale = flDist / 60.0; + flScale = flDist / 60.0f; else - flScale = 0.1; + flScale = 0.1f; switch (m_sSkillNr) { diff --git a/source/src/bot/bot_waypoint.cpp b/source/src/bot/bot_waypoint.cpp index e928dce5..c71235d7 100644 --- a/source/src/bot/bot_waypoint.cpp +++ b/source/src/bot/bot_waypoint.cpp @@ -615,7 +615,7 @@ void CWaypointClass::DrawNearWaypoints() TLinkedList::node_s *pNode; node_s *pNearest = NULL; short i, j, MinI, MaxI, MinJ, MaxJ, Offset = (short)ceilf(15.0f / MAX_MAP_GRIDS); - float flNearestDist = 9999.99, flDist; + float flNearestDist = 9999.99f, flDist; GetNodeIndexes(player1->o, &i, &j); MinI = i - Offset; @@ -1057,7 +1057,7 @@ node_s *CWaypointClass::GetNearestWaypoint(vec v_src, float flRange) TLinkedList::node_s *pNode; node_s *pNearest = NULL; short i, j, MinI, MaxI, MinJ, MaxJ, Offset = (short)ceil(flRange / MAX_MAP_GRIDS); - float flNearestDist = 9999.99, flDist; + float flNearestDist = 9999.99f, flDist; GetNodeIndexes(v_src, &i, &j); MinI = i - Offset; @@ -1104,7 +1104,7 @@ node_s *CWaypointClass::GetNearestTriggerWaypoint(vec v_src, float flRange) TLinkedList::node_s *pNode; node_s *pNearest = NULL; short i, j, MinI, MaxI, MinJ, MaxJ, Offset = (short)ceil(flRange / MAX_MAP_GRIDS); - float flNearestDist = 9999.99, flDist; + float flNearestDist = 9999.99f, flDist; GetNodeIndexes(v_src, &i, &j); MinI = i - Offset; @@ -1547,7 +1547,7 @@ node_s *CWaypointClass::GetNearestFloodWP(vec v_origin, float flRange, node_s *p TLinkedList::node_s *p; node_s *pNearest = NULL; short i, j, MinI, MaxI, MinJ, MaxJ, Offset = (short)ceil(flRange / MAX_MAP_GRIDS); - float flNearestDist = 9999.99, flDist; + float flNearestDist = 9999.99f, flDist; GetNodeIndexes(v_origin, &i, &j); MinI = i - Offset; @@ -1600,7 +1600,7 @@ node_s *CWaypointClass::GetNearestTriggerFloodWP(vec v_origin, float flRange) TLinkedList::node_s *p; node_s *pNearest = NULL; short i, j, MinI, MaxI, MinJ, MaxJ, Offset = (short)ceil(flRange / MAX_MAP_GRIDS); - float flNearestDist = 9999.99, flDist; + float flNearestDist = 9999.99f, flDist; GetNodeIndexes(v_origin, &i, &j); MinI = i - Offset; @@ -1896,7 +1896,7 @@ COMMAND(delwp, ARG_NONE); void wpvisible(int on) { - WaypointClass.SetWaypointsVisible(bool(on)); + WaypointClass.SetWaypointsVisible(on!=0); } COMMAND(wpvisible, ARG_1INT); @@ -1925,7 +1925,7 @@ COMMAND(wpclear, ARG_NONE); void autowp(int on) { WaypointClass.SetWaypointsVisible(true); - WaypointClass.SetAutoWaypoint(bool(on)); + WaypointClass.SetAutoWaypoint(on!=0); } COMMAND(autowp, ARG_1INT); @@ -1933,7 +1933,7 @@ COMMAND(autowp, ARG_1INT); void wpinfo(int on) { WaypointClass.SetWaypointsVisible(true); - WaypointClass.SetWPInfo(bool(on)); + WaypointClass.SetWPInfo(on!=0); } COMMAND(wpinfo, ARG_1INT); @@ -2989,7 +2989,7 @@ waypoint_s *CBot::GetNearestWaypoint(vec v_src, float flRange) TLinkedList::node_s *p; waypoint_s *pNearest = NULL; short i, j, MinI, MaxI, MinJ, MaxJ, Offset = (short)ceil(flRange / MAX_MAP_GRIDS); - float flNearestDist = 9999.99, flDist; + float flNearestDist = 9999.99f, flDist; WaypointClass.GetNodeIndexes(v_src, &i, &j); MinI = i - Offset; @@ -3042,7 +3042,7 @@ waypoint_s *CBot::GetNearestTriggerWaypoint(vec v_src, float flRange) TLinkedList::node_s *p; waypoint_s *pNearest = NULL; short i, j, MinI, MaxI, MinJ, MaxJ, Offset = (short)ceil(flRange / MAX_MAP_GRIDS); - float flNearestDist = 9999.99, flDist; + float flNearestDist = 9999.99f, flDist; WaypointClass.GetNodeIndexes(v_src, &i, &j); MinI = i - Offset; @@ -3134,7 +3134,7 @@ waypoint_s *CBot::GetNearestFloodWP(vec v_origin, float flRange) TLinkedList::node_s *p; waypoint_s *pNearest = NULL; short i, j, MinI, MaxI, MinJ, MaxJ, Offset = (short)ceil(flRange / MAX_MAP_GRIDS); - float flNearestDist = 9999.99, flDist; + float flNearestDist = 9999.99f, flDist; WaypointClass.GetNodeIndexes(v_origin, &i, &j); MinI = i - Offset; @@ -3187,7 +3187,7 @@ waypoint_s *CBot::GetNearestTriggerFloodWP(vec v_origin, float flRange) TLinkedList::node_s *p; waypoint_s *pNearest = NULL; short i, j, MinI, MaxI, MinJ, MaxJ, Offset = (short)ceil(flRange / MAX_MAP_GRIDS); - float flNearestDist = 9999.99, flDist; + float flNearestDist = 9999.99f, flDist; WaypointClass.GetNodeIndexes(v_origin, &i, &j); MinI = i - Offset; diff --git a/source/src/bot/botmanager.cpp b/source/src/bot/botmanager.cpp index 77c6b0e4..67ddbbd6 100644 --- a/source/src/bot/botmanager.cpp +++ b/source/src/bot/botmanager.cpp @@ -148,7 +148,7 @@ void CBotManager::LoadBotNamesFile() break; } - short length = strlen(szNameBuffer); + short length = (short)strlen(szNameBuffer); if (szNameBuffer[length-1] == '\n') { @@ -247,7 +247,7 @@ void CBotManager::LoadBotTeamsFile() while ((m_sBotTeamCount < 20) && (fgets(szNameBuffer, 80, fp) != NULL)) { - short length = strlen(szNameBuffer); + short length = (short)strlen(szNameBuffer); if (szNameBuffer[length-1] == '\n') { @@ -655,7 +655,7 @@ void CBotManager::CreateSkillData() } else if (strcasecmp(cmd, "can_predict_position") == 0) { - m_BotSkills[SkillNr].bCanPredict = value; + m_BotSkills[SkillNr].bCanPredict = value!=0; } else if (strcasecmp(cmd, "max_hear_volume") == 0) { @@ -665,11 +665,11 @@ void CBotManager::CreateSkillData() } else if (strcasecmp(cmd, "can_circle_strafe") == 0) { - m_BotSkills[SkillNr].bCircleStrafe = value; + m_BotSkills[SkillNr].bCircleStrafe = value!=0; } else if (strcasecmp(cmd, "can_search_items_in_combat") == 0) { - m_BotSkills[SkillNr].bCanSearchItemsInCombat = value; + m_BotSkills[SkillNr].bCanSearchItemsInCombat = value!=0; } } @@ -809,7 +809,7 @@ void CBotManager::ChangeBotSkill(short Skill, dynent *bot) // Change default bot skill m_sBotSkill = Skill; - conoutf("Skill of all bots is now %s", (int)SkillNames[Skill]); + conoutf("Skill of all bots is now %s", SkillNames[Skill]); } void CBotManager::ViewBot() @@ -1153,8 +1153,7 @@ void kickbot(const char *szName) { addmsg(SV_BOTDIS, "ri", iBotInd); - conoutf("bot %s disconnected", (int)(bots[iBotInd]->name[0] ? bots[iBotInd]->name : - "[incompatible client]")); + if(bots[iBotInd]->name[0]) conoutf("bot %s disconnected", bots[iBotInd]->name); delete bots[iBotInd]->pBot; zapdynent(bots[iBotInd]); bots.remove(iBotInd); diff --git a/source/vcpp/cube.vcproj b/source/vcpp/cube.vcproj index 31cc9cf5..eb36cd05 100644 --- a/source/vcpp/cube.vcproj +++ b/source/vcpp/cube.vcproj @@ -585,34 +585,10 @@ Name="docs" Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" > - - - - - - - - - - - -