bot zooms/unzooms with the player.
This commit is contained in:
parent
71fdd901c1
commit
20d3a8379c
@ -73,6 +73,9 @@ void WalkTo(const Vector& vector) {
|
|||||||
if (CE_VECTOR(LOCAL_E, netvar.vVelocity).IsZero(1.0f)) {
|
if (CE_VECTOR(LOCAL_E, netvar.vVelocity).IsZero(1.0f)) {
|
||||||
if (!idle_time) idle_time = g_GlobalVars->curtime;
|
if (!idle_time) idle_time = g_GlobalVars->curtime;
|
||||||
if (LOCAL_E->m_vecOrigin.DistTo(vector) > 200.0f) {
|
if (LOCAL_E->m_vecOrigin.DistTo(vector) > 200.0f) {
|
||||||
|
if (LOCAL_E->m_vecOrigin.DistTo(vector) > 500.0f) {
|
||||||
|
if (g_pLocalPlayer->bZoomed) g_pUserCmd->buttons |= IN_ATTACK2;
|
||||||
|
}
|
||||||
if (g_GlobalVars->curtime - idle_time > 2.0f) {
|
if (g_GlobalVars->curtime - idle_time > 2.0f) {
|
||||||
if (!g_pLocalPlayer->bZoomed)
|
if (!g_pLocalPlayer->bZoomed)
|
||||||
g_pUserCmd->buttons |= IN_JUMP;
|
g_pUserCmd->buttons |= IN_JUMP;
|
||||||
@ -111,6 +114,9 @@ void DoWalking() {
|
|||||||
lost_time = 0;
|
lost_time = 0;
|
||||||
if (found_entity->m_vecOrigin.DistTo(LOCAL_E->m_vecOrigin) > 200.0f) WalkTo(found_entity->m_vecOrigin);
|
if (found_entity->m_vecOrigin.DistTo(LOCAL_E->m_vecOrigin) > 200.0f) WalkTo(found_entity->m_vecOrigin);
|
||||||
last_direction = found_entity->m_vecOrigin;
|
last_direction = found_entity->m_vecOrigin;
|
||||||
|
if (HasCondition(found_entity, TFCond_Zoomed)) {
|
||||||
|
if (!g_pLocalPlayer->bZoomed) g_pUserCmd->buttons |= IN_ATTACK2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user