2015-06-30 12:46:07 +03:00
|
|
|
#include "precompiled.h"
|
|
|
|
|
2015-12-05 22:40:30 +03:00
|
|
|
CBaseTutor *TheTutor = NULL;
|
2015-06-30 12:46:07 +03:00
|
|
|
|
|
|
|
/* <1f545d> ../cstrike/dlls/tutor_base_tutor.cpp:22 */
|
2015-08-20 13:35:01 +03:00
|
|
|
TutorMessageEvent::TutorMessageEvent(int mid, int duplicateID, float time, float lifetime, int priority)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
m_messageID = mid;
|
|
|
|
m_duplicateID = duplicateID;
|
|
|
|
m_activationTime = time;
|
|
|
|
m_lifetime = lifetime;
|
|
|
|
m_priority = priority;
|
|
|
|
|
|
|
|
m_paramList = NULL;
|
|
|
|
m_numParameters = 0;
|
|
|
|
m_next = NULL;
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f4d07> ../cstrike/dlls/tutor_base_tutor.cpp:34 */
|
2015-08-20 13:35:01 +03:00
|
|
|
TutorMessageEvent::~TutorMessageEvent(void)
|
|
|
|
{
|
|
|
|
;
|
|
|
|
}
|
2015-06-30 12:46:07 +03:00
|
|
|
|
|
|
|
/* <1f54a6> ../cstrike/dlls/tutor_base_tutor.cpp:38 */
|
2015-08-20 13:35:01 +03:00
|
|
|
bool TutorMessageEvent::IsActive(float time)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
return (m_lifetime + m_activationTime >= time);
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f54da> ../cstrike/dlls/tutor_base_tutor.cpp:48 */
|
2015-08-20 13:35:01 +03:00
|
|
|
int TutorMessageEvent::GetPriority(void)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
return m_priority;
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f5500> ../cstrike/dlls/tutor_base_tutor.cpp:53 */
|
2015-08-20 13:35:01 +03:00
|
|
|
float TutorMessageEvent::GetTimeActive(float time)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
return (time - m_activationTime);
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f5534> ../cstrike/dlls/tutor_base_tutor.cpp:58 */
|
2015-08-20 13:35:01 +03:00
|
|
|
void TutorMessageEvent::SetActivationTime(float time)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
m_activationTime = time;
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f5568> ../cstrike/dlls/tutor_base_tutor.cpp:63 */
|
2015-08-20 13:35:01 +03:00
|
|
|
int TutorMessageEvent::GetID(void)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
return m_messageID;
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f5589> ../cstrike/dlls/tutor_base_tutor.cpp:68 */
|
2015-08-20 13:35:01 +03:00
|
|
|
int TutorMessageEvent::GetDuplicateID(void)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
return m_duplicateID;
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f55af> ../cstrike/dlls/tutor_base_tutor.cpp:73 */
|
2015-08-20 13:35:01 +03:00
|
|
|
void TutorMessageEvent::SetNext(TutorMessageEvent *next)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
m_next = next;
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f55e3> ../cstrike/dlls/tutor_base_tutor.cpp:78 */
|
2015-08-20 13:35:01 +03:00
|
|
|
TutorMessageEvent *TutorMessageEvent::GetNext(void)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
return m_next;
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f5604> ../cstrike/dlls/tutor_base_tutor.cpp:83 */
|
2015-08-20 13:35:01 +03:00
|
|
|
void TutorMessageEvent::AddParameter(char *str)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
if (str == NULL)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
TutorMessageEventParam *param = new TutorMessageEventParam;
|
|
|
|
|
|
|
|
param->m_next = NULL;
|
|
|
|
param->m_data = new char[Q_strlen(str) + 1];
|
|
|
|
|
|
|
|
if (param->m_data != NULL)
|
|
|
|
{
|
|
|
|
Q_strcpy(param->m_data, str);
|
|
|
|
param->m_data[Q_strlen(str)] = '\0';
|
|
|
|
++m_numParameters;
|
|
|
|
|
|
|
|
if (m_paramList != NULL)
|
|
|
|
{
|
|
|
|
TutorMessageEventParam *temp = m_paramList;
|
|
|
|
|
|
|
|
while (temp->m_next)
|
|
|
|
temp = temp->m_next;
|
|
|
|
|
|
|
|
temp->m_next = param;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
m_paramList = param;
|
|
|
|
}
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f565d> ../cstrike/dlls/tutor_base_tutor.cpp:117 */
|
2015-08-20 13:35:01 +03:00
|
|
|
char *TutorMessageEvent::GetNextParameter(char *buf, int buflen)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
TutorMessageEventParam *param = m_paramList;
|
|
|
|
|
|
|
|
if (param == NULL)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_numParameters--;
|
|
|
|
m_paramList = param->m_next;
|
|
|
|
|
|
|
|
Q_strncpy(buf, param->m_data, buflen);
|
|
|
|
|
|
|
|
#ifdef REGAMEDLL_FIXES
|
|
|
|
buf[buflen] = '\0';
|
|
|
|
#endif // REGAMEDLL_FIXES
|
|
|
|
|
|
|
|
delete param;
|
|
|
|
return buf;
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f569e> ../cstrike/dlls/tutor_base_tutor.cpp:136 */
|
2015-08-20 13:35:01 +03:00
|
|
|
int TutorMessageEvent::GetNumParameters(void)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
return m_numParameters;
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f56d8> ../cstrike/dlls/tutor_base_tutor.cpp:144 */
|
2015-08-20 13:35:01 +03:00
|
|
|
CBaseTutor::CBaseTutor(void)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
|
|
|
m_eventList = NULL;
|
|
|
|
m_deadAirStartTime = 0;
|
|
|
|
m_roundStartTime = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f4d28> ../cstrike/dlls/tutor_base_tutor.cpp:152 */
|
2015-08-20 13:35:01 +03:00
|
|
|
CBaseTutor::~CBaseTutor(void)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
TutorMessageEvent *event = m_eventList;
|
|
|
|
|
|
|
|
while (event != NULL)
|
|
|
|
{
|
|
|
|
TutorMessageEvent *temp = event;
|
|
|
|
event = event->GetNext();
|
|
|
|
|
|
|
|
delete temp;
|
|
|
|
}
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f5766> ../cstrike/dlls/tutor_base_tutor.cpp:163 */
|
|
|
|
void CBaseTutor::OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
|
|
|
|
{
|
|
|
|
CallEventHandler(event, entity, other);
|
|
|
|
CheckForStateTransition(event, entity, other);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f5842> ../cstrike/dlls/tutor_base_tutor.cpp:172 */
|
2015-08-20 13:35:01 +03:00
|
|
|
void CBaseTutor::ShotFired(Vector source, Vector target)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
HandleShotFired(source, target);
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f58ca> ../cstrike/dlls/tutor_base_tutor.cpp:178 */
|
2015-08-20 13:35:01 +03:00
|
|
|
void CBaseTutor::CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
|
|
|
if (m_stateSystem->UpdateState(event, entity, other))
|
2015-08-20 13:35:01 +03:00
|
|
|
{
|
2015-06-30 12:46:07 +03:00
|
|
|
DisplayNewStateDescriptionToPlayer();
|
2015-08-20 13:35:01 +03:00
|
|
|
}
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f58f5> ../cstrike/dlls/tutor_base_tutor.cpp:189 */
|
2015-08-20 13:35:01 +03:00
|
|
|
void CBaseTutor::StartFrame(float time)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
|
|
|
TutorThink(time);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f5993> ../cstrike/dlls/tutor_base_tutor.cpp:192 */
|
2015-08-20 13:35:01 +03:00
|
|
|
void CBaseTutor::DisplayMessageToPlayer(CBasePlayer *player, int id, const char *szMessage, TutorMessageEvent *event)
|
|
|
|
{
|
|
|
|
TutorMessage *definition;
|
|
|
|
int numArgs;
|
|
|
|
char param[512];
|
|
|
|
|
|
|
|
numArgs = event->GetNumParameters();
|
|
|
|
definition = GetTutorMessageDefinition(event->GetID());
|
|
|
|
|
|
|
|
MESSAGE_BEGIN(MSG_ONE, gmsgTutorText, NULL, player->pev);
|
|
|
|
WRITE_STRING(szMessage);
|
|
|
|
WRITE_BYTE(numArgs);
|
|
|
|
|
|
|
|
for (int arg = 0; arg < numArgs; arg++)
|
|
|
|
{
|
|
|
|
char *str = event->GetNextParameter(param, sizeof(param));
|
|
|
|
|
|
|
|
if (str != NULL)
|
|
|
|
WRITE_STRING(str);
|
|
|
|
else
|
|
|
|
WRITE_STRING("");
|
|
|
|
}
|
|
|
|
|
|
|
|
WRITE_SHORT(id);
|
|
|
|
WRITE_SHORT(player->IsAlive() == FALSE);
|
|
|
|
|
|
|
|
if (definition != NULL)
|
|
|
|
WRITE_SHORT(definition->m_type);
|
|
|
|
else
|
|
|
|
WRITE_SHORT(TUTORMESSAGETYPE_DEFAULT);
|
|
|
|
MESSAGE_END();
|
|
|
|
|
|
|
|
m_deadAirStartTime = -1.0f;
|
|
|
|
|
|
|
|
if (definition != NULL)
|
|
|
|
{
|
|
|
|
if (gpGlobals->time - m_roundStartTime > 1.0f)
|
|
|
|
{
|
|
|
|
switch (definition->m_type)
|
|
|
|
{
|
|
|
|
case TUTORMESSAGETYPE_FRIEND_DEATH:
|
|
|
|
EMIT_SOUND_DYN(ENT(player->pev), CHAN_ITEM, "events/friend_died.wav", VOL_NORM, ATTN_NORM, 0, 120);
|
|
|
|
break;
|
|
|
|
case TUTORMESSAGETYPE_ENEMY_DEATH:
|
|
|
|
EMIT_SOUND_DYN(ENT(player->pev), CHAN_ITEM, "events/enemy_died.wav", VOL_NORM, ATTN_NORM, 0, 85);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
EMIT_SOUND_DYN(ENT(player->pev), CHAN_ITEM, "events/tutor_msg.wav", VOL_NORM, ATTN_NORM, 0, 100);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (definition->m_decay)
|
|
|
|
{
|
|
|
|
REGISTER_TUTOR_MESSAGE_SHOWN(id);
|
|
|
|
}
|
|
|
|
}
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f5ad1> ../cstrike/dlls/tutor_base_tutor.cpp:264 */
|
2015-08-20 13:35:01 +03:00
|
|
|
NOXREF void CBaseTutor::DrawLineToEntity(CBasePlayer *player, int entindex, int id)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
|
|
|
MESSAGE_BEGIN(MSG_ONE, gmsgTutorLine, NULL, player->pev);
|
|
|
|
WRITE_SHORT(entindex);
|
|
|
|
WRITE_SHORT(id);
|
|
|
|
MESSAGE_END();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f5b4f> ../cstrike/dlls/tutor_base_tutor.cpp:275 */
|
2015-08-20 13:35:01 +03:00
|
|
|
void CBaseTutor::DisplayNewStateDescriptionToPlayer(void)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
|
|
|
CBasePlayer *localPlayer = UTIL_GetLocalPlayer();
|
|
|
|
|
|
|
|
if (localPlayer == NULL)
|
2015-08-20 13:35:01 +03:00
|
|
|
{
|
2015-06-30 12:46:07 +03:00
|
|
|
return;
|
2015-08-20 13:35:01 +03:00
|
|
|
}
|
2015-06-30 12:46:07 +03:00
|
|
|
|
2015-08-20 13:35:01 +03:00
|
|
|
char *desc = m_stateSystem->GetCurrentStateString();
|
2015-06-30 12:46:07 +03:00
|
|
|
|
|
|
|
if (!desc)
|
|
|
|
{
|
|
|
|
MESSAGE_BEGIN(MSG_ONE, gmsgTutorState, NULL, localPlayer->pev);
|
|
|
|
WRITE_STRING(NULL);
|
|
|
|
MESSAGE_END();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f5bb4> ../cstrike/dlls/tutor_base_tutor.cpp:293 */
|
|
|
|
void CBaseTutor::CloseCurrentWindow(void)
|
|
|
|
{
|
|
|
|
CBasePlayer *localPlayer = (CBasePlayer *)UTIL_GetLocalPlayer();
|
|
|
|
|
|
|
|
if (localPlayer != NULL)
|
|
|
|
{
|
|
|
|
MESSAGE_BEGIN(MSG_ONE, gmsgTutorClose, NULL, localPlayer->pev);
|
|
|
|
MESSAGE_END();
|
|
|
|
|
|
|
|
m_deadAirStartTime = gpGlobals->time;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f5c26> ../cstrike/dlls/tutor_base_tutor.cpp:307 */
|
2015-08-20 13:35:01 +03:00
|
|
|
void CBaseTutor::CalculatePathForObjective(CBaseEntity *player)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
;
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f52e6> ../cstrike/dlls/tutor_base_tutor.cpp:312 */
|
2015-08-20 13:35:01 +03:00
|
|
|
bool CBaseTutor::__MAKE_VHOOK(IsEntityInViewOfPlayer)(CBaseEntity *entity, CBasePlayer *player)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
if (entity == NULL || player == NULL)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cv_tutor_view_distance.value < (entity->pev->origin - player->pev->origin).Length())
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (player->FInViewCone(entity))
|
|
|
|
{
|
|
|
|
TraceResult result;
|
|
|
|
Vector eye = player->pev->view_ofs + player->pev->origin;
|
|
|
|
|
|
|
|
UTIL_TraceLine(eye, entity->pev->origin, ignore_monsters, ignore_glass, player->pev->pContainingEntity, &result);
|
|
|
|
|
|
|
|
if (result.flFraction == 1.0f)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f508a> ../cstrike/dlls/tutor_base_tutor.cpp:343 */
|
2015-08-20 13:35:01 +03:00
|
|
|
bool CBaseTutor::__MAKE_VHOOK(IsPlayerLookingAtPosition)(Vector *origin, CBasePlayer *player)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
if (origin == NULL || player == NULL)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cv_tutor_look_distance.value < (*origin - player->pev->origin).Length())
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (player->IsLookingAtPosition(origin, cv_tutor_look_angle.value))
|
|
|
|
{
|
|
|
|
TraceResult result;
|
|
|
|
Vector eye = player->pev->origin + player->pev->view_ofs;
|
|
|
|
|
|
|
|
UTIL_TraceLine(eye, *origin, ignore_monsters, ignore_glass, ENT(player->pev), &result);
|
|
|
|
|
|
|
|
if (result.flFraction == 1.0f)
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f4e92> ../cstrike/dlls/tutor_base_tutor.cpp:373 */
|
2015-08-20 13:35:01 +03:00
|
|
|
bool CBaseTutor::__MAKE_VHOOK(IsPlayerLookingAtEntity)(CBaseEntity *entity, CBasePlayer *player)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
if (entity == NULL || player == NULL)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
UTIL_MakeVectors(player->pev->v_angle);
|
|
|
|
|
|
|
|
Vector srcVec = player->pev->view_ofs + player->pev->origin;
|
|
|
|
Vector destVec = gpGlobals->v_forward * cv_tutor_look_distance.value + srcVec;
|
|
|
|
|
|
|
|
TraceResult result;
|
|
|
|
UTIL_TraceLine(srcVec, destVec, dont_ignore_monsters, ignore_glass, ENT(player->pev), &result);
|
|
|
|
|
|
|
|
if (result.pHit != NULL)
|
|
|
|
{
|
|
|
|
if (!FNullEnt(result.pHit) && CBaseEntity::Instance(result.pHit) == entity)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f51b0> ../cstrike/dlls/tutor_base_tutor.cpp:402 */
|
2015-08-20 13:35:01 +03:00
|
|
|
bool CBaseTutor::__MAKE_VHOOK(IsBombsiteInViewOfPlayer)(CBaseEntity *entity, CBasePlayer *player)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
if (entity == NULL || player == NULL)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
Vector bombSiteCenter = (entity->pev->absmax + entity->pev->absmin) * 0.5;
|
|
|
|
|
|
|
|
if (cv_tutor_view_distance.value < (bombSiteCenter - player->pev->origin).Length())
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (player->FInViewCone(entity))
|
|
|
|
{
|
|
|
|
TraceResult result;
|
|
|
|
Vector eye = player->pev->origin + player->pev->view_ofs;
|
|
|
|
|
|
|
|
UTIL_TraceLine(eye, bombSiteCenter, ignore_monsters, ignore_glass, ENT(player->pev), &result);
|
|
|
|
|
|
|
|
if (result.flFraction == 1.0f)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f4e37> ../cstrike/dlls/tutor_base_tutor.cpp:436 */
|
2015-08-20 13:35:01 +03:00
|
|
|
bool CBaseTutor::__MAKE_VHOOK(IsEntityInBombsite)(CBaseEntity *bombsite, CBaseEntity *entity)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
if (bombsite == NULL || entity == NULL)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (entity->pev->origin.x <= bombsite->pev->absmax.x
|
|
|
|
&& entity->pev->origin.y <= bombsite->pev->absmax.y
|
|
|
|
&& entity->pev->origin.z <= bombsite->pev->absmax.z
|
|
|
|
&& entity->pev->origin.x >= bombsite->pev->absmin.x
|
|
|
|
&& entity->pev->origin.y >= bombsite->pev->absmin.y
|
|
|
|
&& entity->pev->origin.z >= bombsite->pev->absmin.z)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* <1f5c5b> ../cstrike/dlls/tutor_base_tutor.cpp:457 */
|
2015-08-20 13:35:01 +03:00
|
|
|
bool CBaseTutor::DoMessagesHaveSameID(int id1, int id2)
|
|
|
|
{
|
|
|
|
if (id1 == id2)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
TutorMessage *message1 = GetTutorMessageDefinition(id1);
|
|
|
|
TutorMessage *message2 = GetTutorMessageDefinition(id2);
|
|
|
|
|
|
|
|
if (message1 == NULL || message2 == NULL)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (message1->m_duplicateID && message2->m_duplicateID)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef HOOK_GAMEDLL
|
|
|
|
|
|
|
|
bool CBaseTutor::IsEntityInViewOfPlayer(CBaseEntity *entity, CBasePlayer *player)
|
|
|
|
{
|
|
|
|
return IsEntityInViewOfPlayer_(entity, player);
|
|
|
|
}
|
2015-12-09 01:39:54 +03:00
|
|
|
|
2015-08-20 13:35:01 +03:00
|
|
|
bool CBaseTutor::IsBombsiteInViewOfPlayer(CBaseEntity *entity, CBasePlayer *player)
|
2015-06-30 12:46:07 +03:00
|
|
|
{
|
2015-08-20 13:35:01 +03:00
|
|
|
return IsBombsiteInViewOfPlayer_(entity, player);
|
2015-06-30 12:46:07 +03:00
|
|
|
}
|
2015-12-09 01:39:54 +03:00
|
|
|
|
2015-08-20 13:35:01 +03:00
|
|
|
bool CBaseTutor::IsEntityInBombsite(CBaseEntity *bombsite, CBaseEntity *entity)
|
|
|
|
{
|
|
|
|
return IsEntityInBombsite_(bombsite, entity);
|
|
|
|
}
|
2015-12-09 01:39:54 +03:00
|
|
|
|
2015-08-20 13:35:01 +03:00
|
|
|
bool CBaseTutor::IsPlayerLookingAtPosition(Vector *origin, CBasePlayer *player)
|
|
|
|
{
|
|
|
|
return IsPlayerLookingAtPosition_(origin, player);
|
|
|
|
}
|
2015-12-09 01:39:54 +03:00
|
|
|
|
2015-08-20 13:35:01 +03:00
|
|
|
bool CBaseTutor::IsPlayerLookingAtEntity(CBaseEntity *entity, CBasePlayer *player)
|
|
|
|
{
|
|
|
|
return IsPlayerLookingAtEntity_(entity, player);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // HOOK_GAMEDLL
|