Fixed shaky-camera, when bot gets killed.
Make use short bot name here and there. Minor tweaks.
This commit is contained in:
parent
c793ab9ee1
commit
47fefabe66
6 changed files with 14 additions and 6 deletions
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
// general product information
|
// general product information
|
||||||
#define PRODUCT_NAME "Yet Another POD-Bot"
|
#define PRODUCT_NAME "Yet Another POD-Bot"
|
||||||
|
#define PRODUCT_SHORT_NAME "YaPB"
|
||||||
#define PRODUCT_VERSION "2.10"
|
#define PRODUCT_VERSION "2.10"
|
||||||
#define PRODUCT_AUTHOR "YaPB Dev Team"
|
#define PRODUCT_AUTHOR "YaPB Dev Team"
|
||||||
#define PRODUCT_URL "https://yapb.ru/"
|
#define PRODUCT_URL "https://yapb.ru/"
|
||||||
|
|
|
||||||
|
|
@ -2917,7 +2917,7 @@ void Bot::framePeriodic (void) {
|
||||||
// skip some frames
|
// skip some frames
|
||||||
m_thinkFps = engine.timebase () + m_thinkInterval;
|
m_thinkFps = engine.timebase () + m_thinkInterval;
|
||||||
}
|
}
|
||||||
else {
|
else if (m_notKilled) {
|
||||||
processLookAngles ();
|
processLookAngles ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -429,9 +429,16 @@ const Vector &Bot::getEnemyBodyOffset (void) {
|
||||||
if ((m_visibility & VISIBLE_BODY) && !usesSniper () && distance > (m_difficulty > 2 ? 2000.0f : 1000.0f)) {
|
if ((m_visibility & VISIBLE_BODY) && !usesSniper () && distance > (m_difficulty > 2 ? 2000.0f : 1000.0f)) {
|
||||||
m_visibility &= ~VISIBLE_HEAD;
|
m_visibility &= ~VISIBLE_HEAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// do not aim at head while close enough to enemy and having sniper
|
||||||
else if (distance < 800.0f && usesSniper ()) {
|
else if (distance < 800.0f && usesSniper ()) {
|
||||||
m_visibility &= ~VISIBLE_HEAD;
|
m_visibility &= ~VISIBLE_HEAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// do not aim at head while enemy is soooo close enough to enemy when recoil aims at head automatically
|
||||||
|
else if (distance < MAX_SPRAY_DISTANCE) {
|
||||||
|
m_visibility &= ~VISIBLE_HEAD;
|
||||||
|
}
|
||||||
Vector aimPos = m_enemy->v.origin;
|
Vector aimPos = m_enemy->v.origin;
|
||||||
|
|
||||||
if (m_difficulty > 2 && !(m_visibility & VISIBLE_OTHER)) {
|
if (m_difficulty > 2 && !(m_visibility & VISIBLE_OTHER)) {
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ int *g_weaponPrefs[] = {g_normalWeaponPrefs, g_rusherWeaponPrefs, g_carefulWeapo
|
||||||
// metamod plugin information
|
// metamod plugin information
|
||||||
plugin_info_t Plugin_info = {
|
plugin_info_t Plugin_info = {
|
||||||
META_INTERFACE_VERSION, // interface version
|
META_INTERFACE_VERSION, // interface version
|
||||||
PRODUCT_NAME, // plugin name
|
PRODUCT_SHORT_NAME, // plugin name
|
||||||
PRODUCT_VERSION, // plugin version
|
PRODUCT_VERSION, // plugin version
|
||||||
PRODUCT_DATE, // date of creation
|
PRODUCT_DATE, // date of creation
|
||||||
PRODUCT_AUTHOR, // plugin author
|
PRODUCT_AUTHOR, // plugin author
|
||||||
|
|
|
||||||
|
|
@ -507,7 +507,7 @@ void checkWelcome (void) {
|
||||||
if (!(g_gameFlags & (GAME_MOBILITY | GAME_XASH_ENGINE))) {
|
if (!(g_gameFlags & (GAME_MOBILITY | GAME_XASH_ENGINE))) {
|
||||||
engine.execCmd ("speak \"%s\"", sentences.random ().chars ());
|
engine.execCmd ("speak \"%s\"", sentences.random ().chars ());
|
||||||
}
|
}
|
||||||
engine.chatPrint ("----- %s v%s (Build: %u), {%s}, (c) %s, by %s (%s)-----", PRODUCT_NAME, PRODUCT_VERSION, buildNumber (), PRODUCT_DATE, PRODUCT_END_YEAR, PRODUCT_AUTHOR, PRODUCT_URL);
|
engine.chatPrint ("----- %s v%s (Build: %u), {%s}, (c) %s, by %s (%s)-----", PRODUCT_SHORT_NAME, PRODUCT_VERSION, buildNumber (), PRODUCT_DATE, PRODUCT_END_YEAR, PRODUCT_AUTHOR, PRODUCT_URL);
|
||||||
|
|
||||||
MessageWriter (MSG_ONE, SVC_TEMPENTITY, Vector::null (), g_hostEntity)
|
MessageWriter (MSG_ONE, SVC_TEMPENTITY, Vector::null (), g_hostEntity)
|
||||||
.writeByte (TE_TEXTMESSAGE)
|
.writeByte (TE_TEXTMESSAGE)
|
||||||
|
|
@ -527,7 +527,7 @@ void checkWelcome (void) {
|
||||||
.writeShort (MessageWriter::fu16 (2.0f, 1 << 8))
|
.writeShort (MessageWriter::fu16 (2.0f, 1 << 8))
|
||||||
.writeShort (MessageWriter::fu16 (6.0f, 1 << 8))
|
.writeShort (MessageWriter::fu16 (6.0f, 1 << 8))
|
||||||
.writeShort (MessageWriter::fu16 (0.1f, 1 << 8))
|
.writeShort (MessageWriter::fu16 (0.1f, 1 << 8))
|
||||||
.writeString (format ("\nServer is running YaPB v%s (Build: %u)\nDeveloped by %s\n\n%s", PRODUCT_VERSION, buildNumber (), PRODUCT_AUTHOR, waypoints.getAuthor ()));
|
.writeString (format ("\nServer is running %s v%s (Build: %u)\nDeveloped by %s\n\n%s", PRODUCT_SHORT_NAME, PRODUCT_VERSION, buildNumber (), PRODUCT_AUTHOR, waypoints.getAuthor ()));
|
||||||
|
|
||||||
receiveTime = 0.0;
|
receiveTime = 0.0;
|
||||||
messageSent = true;
|
messageSent = true;
|
||||||
|
|
@ -594,7 +594,7 @@ void logEntry (bool outputToConsole, int logLevel, const char *format, ...) {
|
||||||
time_t tickTime = time (&tickTime);
|
time_t tickTime = time (&tickTime);
|
||||||
tm *time = localtime (&tickTime);
|
tm *time = localtime (&tickTime);
|
||||||
|
|
||||||
fp.writeFormat ("%02d:%02d:%02d --> %s%s", time->tm_hour, time->tm_min, time->tm_sec, levelString, buffer);
|
fp.writeFormat ("%02d:%02d:%02d --> %s%s\n", time->tm_hour, time->tm_min, time->tm_sec, levelString, buffer);
|
||||||
fp.close ();
|
fp.close ();
|
||||||
|
|
||||||
if (logLevel == LL_FATAL) {
|
if (logLevel == LL_FATAL) {
|
||||||
|
|
|
||||||
|
|
@ -2809,7 +2809,7 @@ WaypointDownloadError Waypoint::downloadWaypoint (void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
String request;
|
String request;
|
||||||
request.format ("GET /wpdb/%s.pwf HTTP/1.0\r\nAccept: */*\r\nUser-Agent: YaPB/%s\r\nHost: %s\r\n\r\n", engine.getMapName (), PRODUCT_VERSION, yb_waypoint_autodl_host.str ());
|
request.format ("GET /wpdb/%s.pwf HTTP/1.0\r\nAccept: */*\r\nUser-Agent: %s/%s\r\nHost: %s\r\n\r\n", engine.getMapName (), PRODUCT_SHORT_NAME, PRODUCT_VERSION, yb_waypoint_autodl_host.str ());
|
||||||
|
|
||||||
if (send (socketHandle, request.chars (), static_cast <int> (request.length () + 1), 0) < 1) {
|
if (send (socketHandle, request.chars (), static_cast <int> (request.length () + 1), 0) < 1) {
|
||||||
closeSocket (socketHandle);
|
closeSocket (socketHandle);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue