Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linux build and a crash #43

Merged
merged 2 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions sp/src/game/server/hl2/hl2_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1785,7 +1785,7 @@ void CHL2_Player::ReplaceEffects()
{
if (pEffect->DoRestorationAbort())
{
Msg("Killing effect %s\n", pEffect->m_strHudName);
Msg("Killing effect %s\n", STRING(pEffect->m_strHudName));
pEffect->StopEffect();
}
}
Expand All @@ -1805,7 +1805,7 @@ void CHL2_Player::ReplaceEffects()

if (pEffect->DoRestorationAbort())
{
Msg("Restoring effect %s\n", pEffect->m_strHudName);
Msg("Restoring effect %s\n", STRING(pEffect->m_strHudName));
pEffect->RestoreEffect();
}
//make two lists equal again
Expand Down Expand Up @@ -5757,13 +5757,16 @@ void CChaosEffect::AbortEffect()
CHL2_Player *pHL2Player = static_cast<CHL2_Player*>(pPlayer);
pHL2Player->StopGivenEffect(m_nID);
}

void CChaosEffect::RandomTeleport(bool bPlayerOnly)
{
CBasePlayer* pPlayer = UTIL_GetLocalPlayer();
//We could use a more advanced method in the future to allow teleporting to even more places than this allows, but for now, this is good enough
//teleport to a random node
int nRandom = chaos_rng1.GetInt() == -1 ? random->RandomInt(0, g_pBigAINet->NumNodes() - 1) : chaos_rng1.GetInt();
CAI_Node *pNode = g_pBigAINet->GetNode(nRandom);
if ( !pNode )
return; // Some maps may be lacking node graphs
Vector vec = pNode->GetPosition(HULL_HUMAN);
if (pPlayer->GetVehicle() && pPlayer->GetVehicle()->GetVehicleEnt())
{
Expand Down Expand Up @@ -7356,7 +7359,7 @@ void CETreeSpam::StartEffect()
Msg("node %i\n", pNode->GetId());
if (pPlayerNode == pNode)
{
Msg("Tree (node %i) too close to player\n");
Msg("Tree (node %i) too close to player\n", pNode->GetId());
continue;
}
CBaseEntity *pEnt = CreateEntityByName("prop_dynamic");
Expand All @@ -7365,7 +7368,7 @@ void CETreeSpam::StartEffect()
UTIL_TraceLine(vecNodePos + Vector(0, 0, 16), vecNodePos - Vector(0, 0, 100), MASK_SOLID, NULL, COLLISION_GROUP_NONE, &tr);
if (tr.m_pEnt->GetMoveType() == MOVETYPE_VPHYSICS || tr.m_pEnt->IsNPC())
{
Msg("Tree (node %i) on bad ground\n");
Msg("Tree (node %i) on bad ground\n", pNode->GetId());
continue;
}
bool bDone = false;
Expand Down
4 changes: 2 additions & 2 deletions sp/src/game/shared/hl2/hl_gamemovement.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
struct LadderMove_t;
class CInfoLadderDismount;
extern IGameMovement *g_pGameMovement;
extern CHL2GameMovement g_GameMovement;
extern class CHL2GameMovement g_GameMovement;

struct NearbyDismount_t
{
Expand Down Expand Up @@ -128,4 +128,4 @@ inline void CHL2GameMovement::SetLadder( CFuncLadder *ladder )
inline CFuncLadder *CHL2GameMovement::GetLadder()
{
return static_cast<CFuncLadder*>( static_cast<CBaseEntity *>( GetHL2Player()->m_HL2Local.m_hLadder.Get() ) );
}
}