Cosmetic changes for messages before translation.

This commit is contained in:
jeefo 2019-11-30 23:18:37 +03:00
commit 54516190b0
5 changed files with 56 additions and 62 deletions

View file

@ -3559,7 +3559,7 @@ void Bot::camp_ () {
for (int i = 0; i < graph.length (); ++i) { for (int i = 0; i < graph.length (); ++i) {
// skip invisible waypoints or current waypoint // skip invisible waypoints or current waypoint
if (!graph.isVisible (m_currentNodeIndex, i) || (i == m_currentNodeIndex)) { if (!graph.isVisible (m_currentNodeIndex, i) || i == m_currentNodeIndex) {
continue; continue;
} }
const Vector &dotB = (graph[i].origin - pev->origin).normalize2d (); const Vector &dotB = (graph[i].origin - pev->origin).normalize2d ();

View file

@ -124,7 +124,7 @@ int BotControl::cmdVote () {
for (const auto &bot : bots) { for (const auto &bot : bots) {
bot->m_voteMap = mapID; bot->m_voteMap = mapID;
} }
msg ("All dead bots will vote for map #%d", mapID); msg ("All dead bots will vote for map #%d.", mapID);
return BotCommandResult::Handled; return BotCommandResult::Handled;
} }
@ -292,9 +292,7 @@ int BotControl::cmdCvars () {
} }
if (isSave) { if (isSave) {
ctrl.msg ("Bots cvars has been written to file."); msg ("Bots cvars has been written to file.");
cfg.close (); cfg.close ();
} }
return BotCommandResult::Handled; return BotCommandResult::Handled;
@ -567,10 +565,10 @@ int BotControl::cmdNodeDelete () {
// check for existence // check for existence
if (graph.exists (index)) { if (graph.exists (index)) {
graph.erase (index); graph.erase (index);
msg ("Node #%d has beed deleted.", index); msg ("Node %d has beed deleted.", index);
} }
else { else {
msg ("Could not delete node #%d.", index); msg ("Could not delete node %d.", index);
} }
} }
return BotCommandResult::Handled; return BotCommandResult::Handled;
@ -610,10 +608,10 @@ int BotControl::cmdNodeCache () {
// check for existence // check for existence
if (graph.exists (index)) { if (graph.exists (index)) {
graph.cachePoint (index); graph.cachePoint (index);
msg ("Node #%d has been put into the memory.", index); msg ("Node %d has been put into the memory.", index);
} }
else { else {
msg ("Could not put node #%d into the memory.", index); msg ("Could not put node %d into the memory.", index);
} }
} }
return BotCommandResult::Handled; return BotCommandResult::Handled;
@ -640,7 +638,7 @@ int BotControl::cmdNodeClean () {
else if (getStr (option) == "empty" || getStr (option) == "nearest") { else if (getStr (option) == "empty" || getStr (option) == "nearest") {
int removed = graph.clearConnections (graph.getEditorNeareset ()); int removed = graph.clearConnections (graph.getEditorNeareset ());
msg ("Done. Processed node #%d. %d useless paths was cleared.", graph.getEditorNeareset (), removed); msg ("Done. Processed node %d. %d useless paths was cleared.", graph.getEditorNeareset (), removed);
} }
else { else {
int index = getInt (option); int index = getInt (option);
@ -649,10 +647,10 @@ int BotControl::cmdNodeClean () {
if (graph.exists (index)) { if (graph.exists (index)) {
int removed = graph.clearConnections (index); int removed = graph.clearConnections (index);
msg ("Done. Processed node #%d. %d useless paths was cleared.", index, removed); msg ("Done. Processed node %d. %d useless paths was cleared.", index, removed);
} }
else { else {
msg ("Could not process node #%d clearance.", index); msg ("Could not process node %d clearance.", index);
} }
} }
return BotCommandResult::Handled; return BotCommandResult::Handled;
@ -679,7 +677,7 @@ int BotControl::cmdNodeSetRadius () {
float value = getStr (radius).float_ (); float value = getStr (radius).float_ ();
graph.setRadius (radiusIndex, value); graph.setRadius (radiusIndex, value);
msg ("Node #%d has been set to radius %.2f.", radiusIndex, value); msg ("Node %d has been set to radius %.2f.", radiusIndex, value);
return BotCommandResult::Handled; return BotCommandResult::Handled;
} }
@ -713,13 +711,13 @@ int BotControl::cmdNodeTeleport () {
if (graph.exists (index)) { if (graph.exists (index)) {
engfuncs.pfnSetOrigin (graph.getEditor (), graph[index].origin); engfuncs.pfnSetOrigin (graph.getEditor (), graph[index].origin);
msg ("You have been teleported to node #%d.", index); msg ("You have been teleported to node %d.", index);
// turn graph on // turn graph on
graph.setEditFlag (GraphEdit::On | GraphEdit::Noclip); graph.setEditFlag (GraphEdit::On | GraphEdit::Noclip);
} }
else { else {
msg ("Could not teleport to node #%d.", index); msg ("Could not teleport to node %d.", index);
} }
return BotCommandResult::Handled; return BotCommandResult::Handled;
} }

View file

@ -94,7 +94,7 @@ int BotGraph::clearConnections (int index) {
} }
if (top.number == kInvalidNodeIndex) { if (top.number == kInvalidNodeIndex) {
ctrl.msg ("Cannot find path to the closest connected node to node number %d!\n", index); ctrl.msg ("Cannot find path to the closest connected node to node number %d.", index);
return numFixedLinks; return numFixedLinks;
} }
bool sorting = false; bool sorting = false;
@ -395,7 +395,7 @@ void BotGraph::addPath (int addIndex, int pathIndex, float distance) {
// don't allow paths get connected twice // don't allow paths get connected twice
for (const auto &link : path.links) { for (const auto &link : path.links) {
if (link.index == pathIndex) { if (link.index == pathIndex) {
ctrl.msg ("Denied path creation from %d to %d (path already exists)", addIndex, pathIndex); ctrl.msg ("Denied path creation from %d to %d (path already exists).", addIndex, pathIndex);
return; return;
} }
} }
@ -406,7 +406,7 @@ void BotGraph::addPath (int addIndex, int pathIndex, float distance) {
link.index = static_cast <int16> (pathIndex); link.index = static_cast <int16> (pathIndex);
link.distance = cr::abs (static_cast <int> (distance)); link.distance = cr::abs (static_cast <int> (distance));
ctrl.msg ("Path added from %d to %d", addIndex, pathIndex); ctrl.msg ("Path added from %d to %d.", addIndex, pathIndex);
return; return;
} }
} }
@ -423,7 +423,7 @@ void BotGraph::addPath (int addIndex, int pathIndex, float distance) {
} }
if (slot != kInvalidNodeIndex) { if (slot != kInvalidNodeIndex) {
ctrl.msg ("Path added from %d to %d", addIndex, pathIndex); ctrl.msg ("Path added from %d to %d.", addIndex, pathIndex);
path.links[slot].index = static_cast <int16> (pathIndex); path.links[slot].index = static_cast <int16> (pathIndex);
path.links[slot].distance = cr::abs (static_cast <int> (distance)); path.links[slot].distance = cr::abs (static_cast <int> (distance));
@ -571,7 +571,7 @@ void BotGraph::add (int type, const Vector &pos) {
path = &m_paths[index]; path = &m_paths[index];
if (!(path->flags & NodeFlag::Camp)) { if (!(path->flags & NodeFlag::Camp)) {
ctrl.msg ("This is not Camping Node"); ctrl.msg ("This is not camping node.");
return; return;
} }
path->end = m_editor->v.v_angle.get2d (); path->end = m_editor->v.v_angle.get2d ();
@ -864,7 +864,7 @@ void BotGraph::toggleFlags (int toggleFlag) {
} }
else if (!(m_paths[index].flags & toggleFlag)) { else if (!(m_paths[index].flags & toggleFlag)) {
if (toggleFlag == NodeFlag::Sniper && !(m_paths[index].flags & NodeFlag::Camp)) { if (toggleFlag == NodeFlag::Sniper && !(m_paths[index].flags & NodeFlag::Camp)) {
ctrl.msg ("Cannot assign sniper flag to node #%d. This is not camp node.", index); ctrl.msg ("Cannot assign sniper flag to node %d. This is not camp node.", index);
return; return;
} }
m_paths[index].flags |= toggleFlag; m_paths[index].flags |= toggleFlag;
@ -954,7 +954,7 @@ void BotGraph::pathCreate (char dir) {
int nodeFrom = getEditorNeareset (); int nodeFrom = getEditorNeareset ();
if (nodeFrom == kInvalidNodeIndex) { if (nodeFrom == kInvalidNodeIndex) {
ctrl.msg ("Unable to find nearest node in 50 units"); ctrl.msg ("Unable to find nearest node in 50 units.");
return; return;
} }
int nodeTo = m_facingAtIndex; int nodeTo = m_facingAtIndex;
@ -970,7 +970,7 @@ void BotGraph::pathCreate (char dir) {
} }
if (nodeTo == nodeFrom) { if (nodeTo == nodeFrom) {
ctrl.msg ("Unable to connect node with itself"); ctrl.msg ("Unable to connect node with itself.");
return; return;
} }
@ -1053,7 +1053,7 @@ void BotGraph::cachePoint (int index) {
return; return;
} }
m_cacheNodeIndex = node; m_cacheNodeIndex = node;
ctrl.msg ("Node #%d has been put into memory.", m_cacheNodeIndex); ctrl.msg ("Node %d has been put into memory.", m_cacheNodeIndex);
} }
void BotGraph::calculatePathRadius (int index) { void BotGraph::calculatePathRadius (int index) {
@ -1401,7 +1401,7 @@ template <typename U> bool BotGraph::saveStorage (const String &ext, const Strin
filename.assignf ("%s.%s", game.getMapName (), ext.chars ()); filename.assignf ("%s.%s", game.getMapName (), ext.chars ());
if (data.empty ()) { if (data.empty ()) {
logger.error ("Unable to save %s file. Empty data. (filename: '%s')", name.chars (), filename.chars ()); logger.error ("Unable to save %s file. Empty data. (filename: '%s').", name.chars (), filename.chars ());
return false; return false;
} }
else if (isGraph) { else if (isGraph) {
@ -1416,7 +1416,7 @@ template <typename U> bool BotGraph::saveStorage (const String &ext, const Strin
// no open no fun // no open no fun
if (!file) { if (!file) {
logger.error ("Unable to open %s file for writing (filename: '%s')", name.chars (), filename.chars ()); logger.error ("Unable to open %s file for writing (filename: '%s').", name.chars (), filename.chars ());
file.close (); file.close ();
return false; return false;
@ -1449,7 +1449,7 @@ template <typename U> bool BotGraph::saveStorage (const String &ext, const Strin
game.print ("Successfully saved Bots %s data.", name.chars ()); game.print ("Successfully saved Bots %s data.", name.chars ());
} }
else { else {
logger.error ("Unable to compress %s data (filename: '%s')", name.chars (), filename.chars ()); logger.error ("Unable to compress %s data (filename: '%s').", name.chars (), filename.chars ());
file.close (); file.close ();
return false; return false;
@ -1521,7 +1521,7 @@ template <typename U> bool BotGraph::loadStorage (const String &ext, const Strin
return true; return true;
} }
else { else {
game.print ("Can't download '%s'. from '%s' to '%s'... (%d)", filename.chars (), fromDownload, toDownload, http.getLastStatusCode ()); game.print ("Can't download '%s'. from '%s' to '%s'... (%d).", filename.chars (), fromDownload, toDownload, http.getLastStatusCode ());
} }
return false; return false;
}; };
@ -2323,14 +2323,14 @@ bool BotGraph::checkNodes (bool teleportPlayer) {
int connections = 0; int connections = 0;
if (path.number != static_cast <int> (m_paths.index (path))) { if (path.number != static_cast <int> (m_paths.index (path))) {
ctrl.msg ("Node %d path differs from index %d!", path.number, m_paths.index (path)); ctrl.msg ("Node %d path differs from index %d.", path.number, m_paths.index (path));
break; break;
} }
for (const auto &test : path.links) { for (const auto &test : path.links) {
if (test.index != kInvalidNodeIndex) { if (test.index != kInvalidNodeIndex) {
if (test.index > length ()) { if (test.index > length ()) {
ctrl.msg ("Node %d connected with invalid Node #%d!", path.number, test.index); ctrl.msg ("Node %d connected with invalid node %d.", path.number, test.index);
return false; return false;
} }
++connections; ++connections;
@ -2340,14 +2340,14 @@ bool BotGraph::checkNodes (bool teleportPlayer) {
if (connections == 0) { if (connections == 0) {
if (!isConnected (path.number)) { if (!isConnected (path.number)) {
ctrl.msg ("Node %d isn't connected with any other Node!", path.number); ctrl.msg ("Node %d isn't connected with any other node.", path.number);
return false; return false;
} }
} }
if (path.flags & NodeFlag::Camp) { if (path.flags & NodeFlag::Camp) {
if (path.end.empty ()) { if (path.end.empty ()) {
ctrl.msg ("Node %d Camp-Endposition not set!", path.number); ctrl.msg ("Node %d camp-endposition not set.", path.number);
return false; return false;
} }
} }
@ -2367,13 +2367,13 @@ bool BotGraph::checkNodes (bool teleportPlayer) {
for (const auto &test : path.links) { for (const auto &test : path.links) {
if (test.index != kInvalidNodeIndex) { if (test.index != kInvalidNodeIndex) {
if (!exists (test.index)) { if (!exists (test.index)) {
ctrl.msg ("Node %d - Pathindex %d out of Range!", path.number, test.index); ctrl.msg ("Node %d path index %d out of range.", path.number, test.index);
teleport (path); teleport (path);
return false; return false;
} }
else if (test.index == path.number) { else if (test.index == path.number) {
ctrl.msg ("Node %d - Pathindex %d points to itself!", path.number, test.index); ctrl.msg ("Node %d path index %d points to itself.", path.number, test.index);
teleport (path); teleport (path);
return false; return false;
@ -2384,20 +2384,20 @@ bool BotGraph::checkNodes (bool teleportPlayer) {
if (game.mapIs (MapFlags::HostageRescue)) { if (game.mapIs (MapFlags::HostageRescue)) {
if (rescuePoints == 0) { if (rescuePoints == 0) {
ctrl.msg ("You didn't set a Rescue Point!"); ctrl.msg ("You didn't set a rescue point.");
return false; return false;
} }
} }
if (terrPoints == 0) { if (terrPoints == 0) {
ctrl.msg ("You didn't set any Terrorist Important Point!"); ctrl.msg ("You didn't set any terrorist important point.");
return false; return false;
} }
else if (ctPoints == 0) { else if (ctPoints == 0) {
ctrl.msg ("You didn't set any CT Important Point!"); ctrl.msg ("You didn't set any CT important point.");
return false; return false;
} }
else if (goalPoints == 0) { else if (goalPoints == 0) {
ctrl.msg ("You didn't set any Goal Point!"); ctrl.msg ("You didn't set any goal point.");
return false; return false;
} }
@ -2432,7 +2432,7 @@ bool BotGraph::checkNodes (bool teleportPlayer) {
for (const auto &path : m_paths) { for (const auto &path : m_paths) {
if (!visited[path.number]) { if (!visited[path.number]) {
ctrl.msg ("Path broken from Node #0 to Node #%d!", path.number); ctrl.msg ("Path broken from node 0 to node %d.", path.number);
teleport (path); teleport (path);
return false; return false;
@ -2475,7 +2475,7 @@ bool BotGraph::checkNodes (bool teleportPlayer) {
for (const auto &path : m_paths) { for (const auto &path : m_paths) {
if (!visited[path.number]) { if (!visited[path.number]) {
ctrl.msg ("Path broken from Node #%d to Node #0!", path.number); ctrl.msg ("Path broken from node %d to node 0.", path.number);
teleport (path); teleport (path);
return false; return false;
@ -2663,7 +2663,7 @@ void BotGraph::setSearchIndex (int index) {
m_findWPIndex = index; m_findWPIndex = index;
if (exists (m_findWPIndex)) { if (exists (m_findWPIndex)) {
ctrl.msg ("Showing Direction to Node #%d", m_findWPIndex); ctrl.msg ("Showing direction to node %d.", m_findWPIndex);
} }
else { else {
m_findWPIndex = kInvalidNodeIndex; m_findWPIndex = kInvalidNodeIndex;

View file

@ -493,7 +493,7 @@ void BotManager::serverFill (int selection, int personality, int difficulty, int
for (int i = 0; i <= toAdd; ++i) { for (int i = 0; i <= toAdd; ++i) {
addbot ("", difficulty, personality, selection, -1, true); addbot ("", difficulty, personality, selection, -1, true);
} }
ctrl.msg ("Fill Server with %s bots...", &teams[selection][0]); ctrl.msg ("Fill server with %s bots...", &teams[selection][0]);
} }
void BotManager::kickEveryone (bool instant, bool zeroQuota) { void BotManager::kickEveryone (bool instant, bool zeroQuota) {
@ -539,7 +539,7 @@ void BotManager::killAllBots (int team) {
} }
bot->kill (); bot->kill ();
} }
ctrl.msg ("All Bots died !"); ctrl.msg ("All bots died...");
} }
void BotManager::kickBot (int index) { void BotManager::kickBot (int index) {
@ -675,7 +675,7 @@ void BotManager::setWeaponMode (int selection) {
} }
yb_jasonmode.set (selection == 0 ? 1 : 0); yb_jasonmode.set (selection == 0 ? 1 : 0);
ctrl.msg ("%s weapon mode selected", &modes[selection][0]); ctrl.msg ("%s weapon mode selected.", &modes[selection][0]);
} }
void BotManager::listBots () { void BotManager::listBots () {
@ -1282,7 +1282,7 @@ void Bot::kick () {
pev->flags &= ~FL_FAKECLIENT; pev->flags &= ~FL_FAKECLIENT;
game.serverCommand ("kick \"%s\"", username); game.serverCommand ("kick \"%s\"", username);
ctrl.msg ("Bot '%s' kicked", username); ctrl.msg ("Bot '%s' kicked.", username);
} }
void Bot::updateTeamJoin () { void Bot::updateTeamJoin () {
@ -2075,7 +2075,7 @@ void BotConfig::loadLanguageConfig () {
if (game.isDedicated () || game.is (GameFlags::Legacy)) { if (game.isDedicated () || game.is (GameFlags::Legacy)) {
if (game.is (GameFlags::Legacy)) { if (game.is (GameFlags::Legacy)) {
logger.message ("Bots multilingual system disabled, due to your Counter-Strike Version!"); logger.message ("Bots multilingual system disabled, due to your Counter-Strike version!");
} }
return; // dedicated server will use only english translation return; // dedicated server will use only english translation
} }

View file

@ -1158,11 +1158,11 @@ void Bot::findShortestPath (int srcIndex, int destIndex) {
// this function finds the shortest path from source index to destination index // this function finds the shortest path from source index to destination index
if (!graph.exists (srcIndex)){ if (!graph.exists (srcIndex)){
logger.error ("Pathfinder source path index not valid (%d)", srcIndex); logger.error ("Pathfinder source path index not valid (%d).", srcIndex);
return; return;
} }
else if (!graph.exists (destIndex)) { else if (!graph.exists (destIndex)) {
logger.error ("Pathfinder destination path index not valid (%d)", destIndex); logger.error ("Pathfinder destination path index not valid (%d).", destIndex);
return; return;
} }
clearSearchNodes (); clearSearchNodes ();
@ -1366,11 +1366,11 @@ void Bot::findPath (int srcIndex, int destIndex, FindPath pathType /*= FindPath:
} }
if (!graph.exists (srcIndex)) { if (!graph.exists (srcIndex)) {
logger.error ("Pathfinder source path index not valid (%d)", srcIndex); logger.error ("Pathfinder source path index not valid (%d).", srcIndex);
return; return;
} }
else if (!graph.exists (destIndex)) { else if (!graph.exists (destIndex)) {
logger.error ("Pathfinder destination path index not valid (%d)", destIndex); logger.error ("Pathfinder destination path index not valid (%d).", destIndex);
return; return;
} }
clearSearchNodes (); clearSearchNodes ();
@ -2698,19 +2698,17 @@ bool Bot::isDeadlyMove (const Vector &to) {
return false; return false;
} }
#ifdef DEAD_CODE
void Bot::changePitch (float speed) { void Bot::changePitch (float speed) {
// this function turns a bot towards its ideal_pitch // this function turns a bot towards its ideal_pitch
float idealPitch = AngleNormalize (pev->idealpitch); float idealPitch = cr::normalizeAngles (pev->idealpitch);
float curent = AngleNormalize (pev->v_angle.x); float curent = cr::normalizeAngles (pev->v_angle.x);
// turn from the current v_angle pitch to the idealpitch by selecting // turn from the current v_angle pitch to the idealpitch by selecting
// the quickest way to turn to face that direction // the quickest way to turn to face that direction
// find the difference in the curent and ideal angle // find the difference in the curent and ideal angle
float normalizePitch = AngleNormalize (idealPitch - curent); float normalizePitch = cr::normalizeAngles (idealPitch - curent);
if (normalizePitch > 0.0f) { if (normalizePitch > 0.0f) {
if (normalizePitch > speed) { if (normalizePitch > speed) {
@ -2723,7 +2721,7 @@ void Bot::changePitch (float speed) {
} }
} }
pev->v_angle.x = AngleNormalize (curent + normalizePitch); pev->v_angle.x = cr::normalizeAngles (curent + normalizePitch);
if (pev->v_angle.x > 89.9f) { if (pev->v_angle.x > 89.9f) {
pev->v_angle.x = 89.9f; pev->v_angle.x = 89.9f;
@ -2738,14 +2736,14 @@ void Bot::changePitch (float speed) {
void Bot::changeYaw (float speed) { void Bot::changeYaw (float speed) {
// this function turns a bot towards its ideal_yaw // this function turns a bot towards its ideal_yaw
float idealPitch = AngleNormalize (pev->ideal_yaw); float idealPitch = cr::normalizeAngles (pev->ideal_yaw);
float curent = AngleNormalize (pev->v_angle.y); float curent = cr::normalizeAngles (pev->v_angle.y);
// turn from the current v_angle yaw to the ideal_yaw by selecting // turn from the current v_angle yaw to the ideal_yaw by selecting
// the quickest way to turn to face that direction // the quickest way to turn to face that direction
// find the difference in the curent and ideal angle // find the difference in the curent and ideal angle
float normalizePitch = AngleNormalize (idealPitch - curent); float normalizePitch = cr::normalizeAngles (idealPitch - curent);
if (normalizePitch > 0.0f) { if (normalizePitch > 0.0f) {
if (normalizePitch > speed) { if (normalizePitch > speed) {
@ -2757,12 +2755,10 @@ void Bot::changeYaw (float speed) {
normalizePitch = -speed; normalizePitch = -speed;
} }
} }
pev->v_angle.y = AngleNormalize (curent + normalizePitch); pev->v_angle.y = cr::normalizeAngles (curent + normalizePitch);
pev->angles.y = pev->v_angle.y; pev->angles.y = pev->v_angle.y;
} }
#endif
int Bot::findCampingDirection () { int Bot::findCampingDirection () {
// find a good node to look at when camping // find a good node to look at when camping