removed useless things
merged changes for xash csdm into master
This commit is contained in:
parent
579971c5ff
commit
4b8c18001d
11 changed files with 102 additions and 334 deletions
|
|
@ -1240,7 +1240,7 @@ void Bot::CheckMessageQueue (void)
|
|||
}
|
||||
}
|
||||
|
||||
if (m_radioSelect != Radio_ReportingIn && g_radioInsteadVoice || yb_communication_type.GetInt () != 2 || g_chatterFactory[m_radioSelect].IsEmpty () || g_gameVersion == CSV_OLD)
|
||||
if (m_radioSelect != Radio_ReportingIn || g_radioInsteadVoice || yb_communication_type.GetInt () != 2 || g_chatterFactory[m_radioSelect].IsEmpty () || g_gameVersion == CSV_OLD)
|
||||
{
|
||||
if (m_radioSelect < Radio_GoGoGo)
|
||||
FakeClientCommand (GetEntity (), "radio1");
|
||||
|
|
@ -2964,6 +2964,11 @@ void Bot::ThinkDelayed (void)
|
|||
else if (m_notKilled && m_buyingFinished && !(pev->maxspeed < 10.0f && GetTaskId () != TASK_PLANTBOMB && GetTaskId () != TASK_DEFUSEBOMB) && !yb_freeze_bots.GetBool ())
|
||||
botMovement = true;
|
||||
|
||||
#ifdef XASH_CSDM
|
||||
if (m_notKilled)
|
||||
botMovement = true;
|
||||
#endif
|
||||
|
||||
CheckMessageQueue (); // check for pending messages
|
||||
|
||||
// remove voice icon
|
||||
|
|
|
|||
|
|
@ -980,6 +980,7 @@ int Spawn (edict_t *ent)
|
|||
}
|
||||
else if (strcmp (STRING (ent->v.classname), "player_weaponstrip") == 0 && (STRING (ent->v.target))[0] == '0')
|
||||
ent->v.target = ent->v.targetname = ALLOC_STRING ("fake");
|
||||
#ifndef XASH_CSDM
|
||||
else if (strcmp (STRING (ent->v.classname), "info_player_start") == 0)
|
||||
{
|
||||
SET_MODEL (ent, ENGINE_STR ("models/player/urban/urban.mdl"));
|
||||
|
|
@ -1005,6 +1006,7 @@ int Spawn (edict_t *ent)
|
|||
ent->v.renderamt = 127; // set its transparency amount
|
||||
ent->v.effects |= EF_NODRAW;
|
||||
}
|
||||
#endif
|
||||
else if (strcmp (STRING (ent->v.classname), "func_vip_safetyzone") == 0 || strcmp (STRING (ent->v.classname), "info_vip_safetyzone") == 0)
|
||||
g_mapType |= MAP_AS; // assassination map
|
||||
|
||||
|
|
@ -3029,7 +3031,7 @@ DLL_GIVEFNPTRSTODLL GiveFnptrsToDll (enginefuncs_t *functionTable, globalvars_t
|
|||
#endif
|
||||
|
||||
char gameDLLName[256];
|
||||
snprintf (gameDLLName, sizeof (gameDLLName), "%s/%s", getenv ("XASH3D_GAMELIBDIR"), GAME_SERVER_DLL);
|
||||
snprintf (gameDLLName, SIZEOF_CHAR (gameDLLName), "%s/%s", getenv ("XASH3D_GAMELIBDIR"), GAME_SERVER_DLL);
|
||||
|
||||
g_gameLib = new Library (gameDLLName);
|
||||
|
||||
|
|
@ -3051,6 +3053,7 @@ DLL_GIVEFNPTRSTODLL GiveFnptrsToDll (enginefuncs_t *functionTable, globalvars_t
|
|||
{ "czero", "cs_i386.so", "cs.dylib", "mp.dll", "Counter-Strike: Condition Zero", CSV_CZERO },
|
||||
{ "czero", "cs.so", "cs.dylib", "mp.dll", "Counter-Strike: Condition Zero (Newer)", CSV_CZERO },
|
||||
{ "csv15", "cs_i386.so", "cs.dylib", "mp.dll", "CS 1.5 for Steam", CSV_OLD },
|
||||
{ "csdm", "cs_i386.so", "cs.dylib", "mp.dll", "CSDM for Windows", CSV_OLD },
|
||||
{ "cs13", "cs_i386.so", "cs.dylib", "mp.dll", "Counter-Strike v1.3", CSV_OLD }, // assume cs13 = cs15
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ BotManager::BotManager (void)
|
|||
|
||||
m_maintainTime = 0.0f;
|
||||
m_creationTab.RemoveAll ();
|
||||
m_killerEntity = NULL;
|
||||
}
|
||||
|
||||
BotManager::~BotManager (void)
|
||||
|
|
@ -1181,6 +1182,29 @@ void Bot::StartGame (void)
|
|||
{
|
||||
// this function handles the selection of teams & class
|
||||
|
||||
#ifdef XASH_CSDM
|
||||
m_wantedTeam = Random.Long (1, 2);
|
||||
|
||||
FakeClientCommand (GetEntity (), "jointeam %d", m_wantedTeam);
|
||||
|
||||
if (m_wantedTeam == 2)
|
||||
{
|
||||
SET_MODEL (GetEntity (), ENGINE_STR ("models/player/Counter-Terrorists/Counter-Terrorists.mdl"));
|
||||
SET_CLIENT_KEYVALUE (GetIndex (), GET_INFOKEYBUFFER (GetEntity ()), "model", "Counter-Terrorists");
|
||||
}
|
||||
else
|
||||
{
|
||||
SET_MODEL (GetEntity (), ENGINE_STR ("models/player/Terrorists/Terrorists.mdl"));
|
||||
SET_CLIENT_KEYVALUE (GetIndex (), GET_INFOKEYBUFFER (GetEntity ()), "model", "Terrorists");
|
||||
}
|
||||
|
||||
if (Random.Long (0, 100) < 20)
|
||||
ChatMessage (CHAT_WELCOME);
|
||||
|
||||
m_notStarted = false;
|
||||
return;
|
||||
#endif
|
||||
|
||||
// handle counter-strike stuff here...
|
||||
if (m_startAction == GSM_TEAM_SELECT)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -431,14 +431,14 @@ void Bot::CheckTerrain (float movedDistance, const Vector &dirNormal)
|
|||
// collision check allowed if not flying through the air
|
||||
if (IsOnFloor () || IsOnLadder () || IsInWater ())
|
||||
{
|
||||
char state[MAX_COLLIDE_MOVES * 2];
|
||||
char state[MAX_COLLIDE_MOVES * 2 + 1];
|
||||
int i = 0;
|
||||
|
||||
// first 4 entries hold the possible collision states
|
||||
state[i++] = COLLISION_STRAFELEFT;
|
||||
state[i++] = COLLISION_STRAFERIGHT;
|
||||
state[i++] = COLLISION_JUMP;
|
||||
// state[i++] = COLLISION_DUCK;
|
||||
// state[i++] = COLLISION_DUCK;
|
||||
|
||||
if (bits & PROBE_STRAFE)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -461,17 +461,21 @@ void NetworkMsg::Execute (void *p)
|
|||
case 4:
|
||||
if (playerIndex >= 0 && playerIndex <= GetMaxClients ())
|
||||
{
|
||||
#ifndef XASH_CSDM
|
||||
Client &cl = g_clients[playerIndex - 1];
|
||||
|
||||
if (PTR_TO_INT (p) == 1)
|
||||
g_clients[playerIndex - 1].realTeam = TEAM_TF;
|
||||
cl.realTeam = TEAM_TF;
|
||||
else if (PTR_TO_INT (p) == 2)
|
||||
g_clients[playerIndex - 1].realTeam = TEAM_CF;
|
||||
cl.realTeam = TEAM_CF;
|
||||
else
|
||||
g_clients[playerIndex - 1].realTeam = TEAM_SPEC;
|
||||
cl.realTeam = TEAM_SPEC;
|
||||
|
||||
if (yb_csdm_mode.GetInt () == 2)
|
||||
g_clients[playerIndex - 1].team = playerIndex;
|
||||
cl.team = playerIndex;
|
||||
else
|
||||
g_clients[playerIndex - 1].team = g_clients[playerIndex - 1].realTeam;
|
||||
cl.team = g_clients[playerIndex - 1].realTeam;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,12 @@
|
|||
ConVar yb_listenserver_welcome ("yb_listenserver_welcome", "1", VT_NOSERVER);
|
||||
|
||||
ConVar mp_roundtime ("mp_roundtime", NULL, VT_NOREGISTER);
|
||||
|
||||
#ifndef XASH_CSDM
|
||||
ConVar mp_freezetime ("mp_freezetime", NULL, VT_NOREGISTER);
|
||||
#else
|
||||
ConVar mp_freezetime ("mp_freezetime", "0", VT_NOSERVER);
|
||||
#endif
|
||||
|
||||
void TraceLine (const Vector &start, const Vector &end, bool ignoreMonsters, bool ignoreGlass, edict_t *ignoreEntity, TraceResult *ptr)
|
||||
{
|
||||
|
|
@ -742,7 +747,6 @@ void RoundInit (void)
|
|||
g_radioSelect[i] = 0;
|
||||
}
|
||||
waypoints.SetBombPosition (true);
|
||||
waypoints.ClearGoalScore ();
|
||||
|
||||
g_bombSayString = false;
|
||||
g_timeBombPlanted = 0.0f;
|
||||
|
|
|
|||
|
|
@ -2446,41 +2446,6 @@ void Waypoint::SetFindIndex (int index)
|
|||
m_findWPIndex = -1;
|
||||
}
|
||||
|
||||
int Waypoint::AddGoalScore (int index, int other[4])
|
||||
{
|
||||
Array <int> left;
|
||||
|
||||
if (m_goalsScore[index] < 1024.0f)
|
||||
left.Push (index);
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if (m_goalsScore[other[i]] < 1024.0f)
|
||||
left.Push (other[i]);
|
||||
}
|
||||
|
||||
if (left.IsEmpty ())
|
||||
index = other[Random.Long (0, 3)];
|
||||
else
|
||||
index = left.GetRandomElement ();
|
||||
|
||||
if (m_paths[index]->flags & FLAG_GOAL)
|
||||
m_goalsScore[index] += 384.0f;
|
||||
else if (m_paths[index]->flags & (FLAG_CF_ONLY | FLAG_TF_ONLY))
|
||||
m_goalsScore[index] += 768.0f;
|
||||
else if (m_paths[index]->flags & FLAG_CAMP)
|
||||
m_goalsScore[index] += 1024.0f;
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
void Waypoint::ClearGoalScore (void)
|
||||
{
|
||||
// iterate though all waypoints
|
||||
for (int i = 0; i < MAX_WAYPOINTS; i++)
|
||||
m_goalsScore[i] = 0.0f;
|
||||
}
|
||||
|
||||
Waypoint::Waypoint (void)
|
||||
{
|
||||
m_waypointPaths = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue