crouching

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1419 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2007-11-11 14:20:52 +00:00
parent 9d74fda65d
commit eb81f05ec9
14 changed files with 56 additions and 46 deletions
+3 -3
View File
@@ -120,7 +120,7 @@ entity *CACBot::SearchForEnts(bool bUseWPs, float flRange, float flMaxHeight)
{
sScore = 0;
entity &e = ents[i];
vec o(e.x, e.y, S(e.x, e.y)->floor+player1->eyeheight);
vec o(e.x, e.y, S(e.x, e.y)->floor+player1->dyneyeheight());
if (!ents[i].spawned) continue;
if (OUTBORD(e.x, e.y)) continue;
@@ -234,7 +234,7 @@ entity *CACBot::SearchForEnts(bool bUseWPs, float flRange, float flMaxHeight)
m_vGoal.x = pNewTargetEnt->x;
m_vGoal.y = pNewTargetEnt->y;
m_vGoal.z = S(pNewTargetEnt->x, pNewTargetEnt->y)->floor+player1->eyeheight;
m_vGoal.z = S(pNewTargetEnt->x, pNewTargetEnt->y)->floor+player1->dyneyeheight();
}
return pNewTargetEnt;
@@ -245,7 +245,7 @@ bool CACBot::HeadToTargetEnt()
if (m_pTargetEnt)
{
vec o(m_pTargetEnt->x, m_pTargetEnt->y,
S(m_pTargetEnt->x, m_pTargetEnt->y)->floor+m_pMyEnt->eyeheight);
S(m_pTargetEnt->x, m_pTargetEnt->y)->floor+m_pMyEnt->dyneyeheight());
if (m_pTargetEnt->spawned && (!UnderWater(m_pMyEnt->o) ||
!UnderWater(o)))
+2 -2
View File
@@ -981,7 +981,7 @@ void CBot::DoCombatNav()
{
// Bot has already found an entity, still valid?
vec v(m_pTargetEnt->x, m_pTargetEnt->y,
S(m_pTargetEnt->x, m_pTargetEnt->y)->floor+m_pMyEnt->eyeheight);
S(m_pTargetEnt->x, m_pTargetEnt->y)->floor+m_pMyEnt->dyneyeheight());
if ((GetDistance(v) > 25.0f) || !IsVisible(m_pTargetEnt))
m_pTargetEnt = NULL;
}
@@ -1002,7 +1002,7 @@ void CBot::DoCombatNav()
{
condebug("Combat ent");
vec v(m_pTargetEnt->x, m_pTargetEnt->y,
S(m_pTargetEnt->x, m_pTargetEnt->y)->floor+m_pMyEnt->eyeheight);
S(m_pTargetEnt->x, m_pTargetEnt->y)->floor+m_pMyEnt->dyneyeheight());
debugbeam(m_pMyEnt->o, v);
+7 -7
View File
@@ -1705,7 +1705,7 @@ void CCubeWaypointClass::StartFlood()
if (e.type == TELEPORT)
{
vec telepos = { e.x, e.y, S(e.x, e.y)->floor+player1->eyeheight }, teledestpos = g_vecZero;
vec telepos = { e.x, e.y, S(e.x, e.y)->floor+player1->dyneyeheight() }, teledestpos = g_vecZero;
// Find the teleport destination
int n = -1, tag = e.attr1, beenhere = -1;
@@ -1718,7 +1718,7 @@ void CCubeWaypointClass::StartFlood()
{
teledestpos.x = ents[n].x;
teledestpos.y = ents[n].y;
teledestpos.z = S(ents[n].x, ents[n].y)->floor+player1->eyeheight;
teledestpos.z = S(ents[n].x, ents[n].y)->floor+player1->dyneyeheight();
break;
}
}
@@ -1757,7 +1757,7 @@ void CCubeWaypointClass::StartFlood()
}
else if (e.type == CARROT)
{
vec pos = { e.x, e.y, S(e.x, e.y)->floor+player1->eyeheight };
vec pos = { e.x, e.y, S(e.x, e.y)->floor+player1->dyneyeheight() };
int flags = (W_FL_FLOOD | W_FL_TRIGGER);
if (S(e.x, e.y)->tag) flags |= W_FL_INTAG;
@@ -1825,7 +1825,7 @@ void CCubeWaypointClass::CreateWPsAtTeleporters()
if (e.type != TELEPORT) continue;
if (OUTBORD(e.x, e.y)) continue;
vec telepos = { e.x, e.y, S(e.x, e.y)->floor+player1->eyeheight }, teledestpos = g_vecZero;
vec telepos = { e.x, e.y, S(e.x, e.y)->floor+player1->dyneyeheight() }, teledestpos = g_vecZero;
// Find the teleport destination
int n = -1, tag = e.attr1, beenhere = -1;
@@ -1838,7 +1838,7 @@ void CCubeWaypointClass::CreateWPsAtTeleporters()
{
teledestpos.x = ents[n].x;
teledestpos.y = ents[n].y;
teledestpos.z = S(ents[n].x, ents[n].y)->floor+player1->eyeheight;
teledestpos.z = S(ents[n].x, ents[n].y)->floor+player1->dyneyeheight();
break;
}
}
@@ -1870,7 +1870,7 @@ void CCubeWaypointClass::CreateWPsAtTriggers()
if (e.type != CARROT) continue;
if (OUTBORD(e.x, e.y)) continue;
vec pos = { e.x, e.y, S(e.x, e.y)->floor+player1->eyeheight };
vec pos = { e.x, e.y, S(e.x, e.y)->floor+player1->dyneyeheight() };
node_s *wp = AddWaypoint(pos, false);
@@ -2391,7 +2391,7 @@ bool CBot::HeadToWaypoint()
{
// Check if bot has to jump
vec from = m_pMyEnt->o;
from.z -= (m_pMyEnt->eyeheight - 1.25f);
from.z -= (m_pMyEnt->dyneyeheight() - 1.25f);
float flEndDist;
if (!IsVisible(from, FORWARD, 3.0f, false, &flEndDist) &&
(GetDistance(from, m_pCurrentWaypoint->pNode->v_origin) > flEndDist))
+5 -4
View File
@@ -859,7 +859,7 @@ void CBotManager::PickNextTrigger()
#endif
if (OUTBORD(e.x, e.y)) continue;
vec o(e.x, e.y, S(e.x, e.y)->floor+player1->eyeheight);
vec o(e.x, e.y, S(e.x, e.y)->floor+player1->dyneyeheight());
node_s *pWptNearEnt = NULL;
@@ -971,6 +971,7 @@ void addbot(char *arg1, char *arg2, char *arg3)
if(!botmode()) return;
conoutf("Creating bot...\n");
botent *b = BotManager.CreateBot(arg1, arg2, arg3);
if (b)
conoutf("connected: %s", b->name);
else
@@ -1179,7 +1180,7 @@ void drawbeamtocarrots()
loopv(ents)
{
entity &e = ents[i];
vec o = { e.x, e.y, S(e.x, e.y)->floor+player1->eyeheight };
vec o = { e.x, e.y, S(e.x, e.y)->floor+player1->dyneyeheight() };
if ((e.type != CARROT) || !e.spawned) continue;
particle_trail(1, 500, player1->o, o);
}
@@ -1192,7 +1193,7 @@ void drawbeamtoteleporters()
loopv(ents)
{
entity &e = ents[i];
vec o = { e.x, e.y, S(e.x, e.y)->floor+player1->eyeheight };
vec o = { e.x, e.y, S(e.x, e.y)->floor+player1->dyneyeheight() };
if (e.type != TELEPORT) continue;
particle_trail(1, 500, player1->o, o);
}
@@ -1245,7 +1246,7 @@ void testvisible(int iDir)
}
vec from = player1->o;
from.z -= (player1->eyeheight - 1.25f);
from.z -= (player1->dyneyeheight() - 1.25f);
end = from;
makevec(&angles, player1->pitch, player1->yaw, player1->roll);
angles.x=0;