Skip to content

Commit 537f3ed

Browse files
committed
fixes
1 parent 81a645e commit 537f3ed

File tree

5 files changed

+5
-61
lines changed

5 files changed

+5
-61
lines changed

src/game/server/hl2/npc_citizen17.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "hl2_player.h"
1717
#include "items.h"
1818

19-
2019
#ifdef HL2MP
2120
#include "hl2mp/weapon_crowbar.h"
2221
#else

src/game/shared/hl2/hl2_gamerules.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,6 +1781,7 @@ bool CHalfLife2::IsAlyxInDarknessMode()
17811781
}
17821782
#endif
17831783

1784+
#ifndef BDSBASE
17841785
//-----------------------------------------------------------------------------
17851786
// This takes the long way around to see if a prop should emit a DLIGHT when it
17861787
// ignites, to avoid having Alyx-related code in props.cpp.
@@ -1793,6 +1794,7 @@ bool CHalfLife2::ShouldBurningPropsEmitLight()
17931794
return false;
17941795
#endif // HL2_EPISODIC
17951796
}
1797+
#endif
17961798

17971799

17981800
#endif//CLIENT_DLL

src/game/shared/hl2mp/hl2mp_gamerules.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,9 +2446,6 @@ void CHL2MPRules::InitDefaultAIRelationships(void)
24462446
}
24472447
#endif //BDSBASE
24482448

2449-
//TDT - Episodic Issues: Here we add darkness mode so that it now works.
2450-
#ifndef CLIENT_DLL
2451-
24522449
//-----------------------------------------------------------------------------
24532450
// Returns whether or not Alyx cares about light levels in order to see.
24542451
//-----------------------------------------------------------------------------
@@ -2480,6 +2477,4 @@ bool CHL2MPRules::ShouldBurningPropsEmitLight()
24802477
#endif // HL2_EPISODIC
24812478
}
24822479

2483-
#endif//CLIENT_DLL
2484-
24852480
#endif

src/game/shared/hl2mp/hl2mp_gamerules.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,13 @@ class CHL2MPRules : public CTeamplayRules
9191
#else
9292

9393
DECLARE_SERVERCLASS_NOBASE(); // This makes datatables able to access our private vars.
94-
#endif
9594

9695
//TDT - Episodic Issues: Here we add darkness mode so that it now works.
9796
virtual bool IsAlyxInDarknessMode();
9897
virtual bool ShouldBurningPropsEmitLight();
98+
99+
virtual void InitDefaultAIRelationships(void);
100+
#endif
99101

100102
CHL2MPRules();
101103
virtual ~CHL2MPRules();
@@ -104,8 +106,6 @@ class CHL2MPRules : public CTeamplayRules
104106
virtual bool ShouldCollide( int collisionGroup0, int collisionGroup1 );
105107
virtual bool ClientCommand( CBaseEntity *pEdict, const CCommand &args );
106108

107-
virtual void InitDefaultAIRelationships(void);
108-
109109
virtual float FlWeaponRespawnTime( CBaseCombatWeapon *pWeapon );
110110
virtual float FlWeaponTryRespawn( CBaseCombatWeapon *pWeapon );
111111
virtual Vector VecWeaponRespawnSpot( CBaseCombatWeapon *pWeapon );

src/game/shared/hl2mp/weapon_crowbar.cpp

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -106,58 +106,6 @@ void CWeaponCrowbar::AddViewKick( void )
106106

107107

108108
#ifndef CLIENT_DLL
109-
#ifdef BDSBASE
110-
//-----------------------------------------------------------------------------
111-
// Attempt to lead the target (needed because citizens can't hit manhacks with the crowbar!)
112-
//-----------------------------------------------------------------------------
113-
ConVar sk_crowbar_lead_time("sk_crowbar_lead_time", "0.9");
114-
115-
int CWeaponCrowbar::WeaponMeleeAttack1Condition(float flDot, float flDist)
116-
{
117-
// Attempt to lead the target (needed because citizens can't hit manhacks with the crowbar!)
118-
CAI_BaseNPC* pNPC = GetOwner()->MyNPCPointer();
119-
CBaseEntity* pEnemy = pNPC->GetEnemy();
120-
if (!pEnemy)
121-
return COND_NONE;
122-
123-
Vector vecVelocity;
124-
vecVelocity = pEnemy->GetSmoothedVelocity();
125-
126-
// Project where the enemy will be in a little while
127-
float dt = sk_crowbar_lead_time.GetFloat();
128-
dt += random->RandomFloat(-0.3f, 0.2f);
129-
if (dt < 0.0f)
130-
dt = 0.0f;
131-
132-
Vector vecExtrapolatedPos;
133-
VectorMA(pEnemy->WorldSpaceCenter(), dt, vecVelocity, vecExtrapolatedPos);
134-
135-
Vector vecDelta;
136-
VectorSubtract(vecExtrapolatedPos, pNPC->WorldSpaceCenter(), vecDelta);
137-
138-
if (fabs(vecDelta.z) > 70)
139-
{
140-
return COND_TOO_FAR_TO_ATTACK;
141-
}
142-
143-
Vector vecForward = pNPC->BodyDirection2D();
144-
vecDelta.z = 0.0f;
145-
float flExtrapolatedDist = Vector2DNormalize(vecDelta.AsVector2D());
146-
if ((flDist > 64) && (flExtrapolatedDist > 64))
147-
{
148-
return COND_TOO_FAR_TO_ATTACK;
149-
}
150-
151-
float flExtrapolatedDot = DotProduct2D(vecDelta.AsVector2D(), vecForward.AsVector2D());
152-
if ((flDot < 0.7) && (flExtrapolatedDot < 0.7))
153-
{
154-
return COND_NOT_FACING_ATTACK;
155-
}
156-
157-
return COND_CAN_MELEE_ATTACK1;
158-
}
159-
#endif //BDSBASE
160-
161109
//-----------------------------------------------------------------------------
162110
// Animation event handlers
163111
//-----------------------------------------------------------------------------

0 commit comments

Comments
 (0)