Skip to content

Commit f8e0727

Browse files
committed
Various fixes
1 parent 949abfa commit f8e0727

File tree

9 files changed

+140
-2074
lines changed

9 files changed

+140
-2074
lines changed

src/core/modules/entities/entities.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class TakeDamageInfoBaseWrapper: public CTakeDamageInfo
102102

103103
void set_inflictor(unsigned int uiInflictor)
104104
{
105-
m_hInflictor = ExcBaseHandleFromIndex(uiInflictor);
105+
m_hInflictor = CHandle<CBaseEntity>(ExcBaseEntityFromIndex(uiInflictor));
106106
}
107107

108108
unsigned int get_attacker()
@@ -144,7 +144,7 @@ class TakeDamageInfoBaseWrapper: public CTakeDamageInfo
144144
m_CSGOAttacker.m_iUserId = -1;
145145
}
146146
#else
147-
m_hAttacker = ExcBaseHandleFromIndex(uiAttacker);
147+
m_hAttacker = CHandle<CBaseEntity>(ExcBaseEntityFromIndex(uiAttacker));
148148
#endif
149149
}
150150

@@ -172,7 +172,7 @@ class TakeDamageInfoBaseWrapper: public CTakeDamageInfo
172172

173173
void set_weapon(unsigned int uiWeapon)
174174
{
175-
m_hWeapon = ExcBaseHandleFromIndex(uiWeapon);
175+
m_hWeapon = CHandle<CBaseEntity>(ExcBaseEntityFromIndex(uiWeapon));
176176
}
177177

178178
void set_base_damage(float flBaseDamage)

src/core/modules/keyvalues/keyvalues_wrap.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,35 +32,35 @@
3232

3333

3434

35-
// Really hacky way to access the private member function RecursiveCopyKeyValues.
36-
// It's done by replacing the declaration of RecursiveCopyKeyValues with a dummy
35+
// Really hacky way to access the private member function CopyKeyValuesFromRecursive.
36+
// It's done by replacing the declaration of CopyKeyValuesFromRecursive with a dummy
3737
// method, a friend function declaration and the actual declaration that got
3838
// replaced.
3939
// This is done, so we don't need to patch KeyValues.h. #define private public
4040
// doesn't work here, because of undefined symbols (KeyValues.cpp compiles the
4141
// function as a private symbol name, and keyvalues_wrap.cpp would try to look up
4242
// the function using its public symbol name).
4343
/*
44-
void RecursiveCopyKeyValues( KeyValues& src );
44+
void CopyKeyValuesFromRecursive( KeyValues& src );
4545
4646
REPLACED BY:
4747
4848
void JustFinishTheDeclaration() {}
49-
friend void RecursiveCopyKeyValuesHack(KeyValues* pThis, KeyValues& src);
50-
void RecursiveCopyKeyValues( KeyValues& src );
49+
friend void CopyKeyValuesFromRecursiveHack(KeyValues* pThis, KeyValues& src);
50+
void CopyKeyValuesFromRecursive( KeyValues& src );
5151
*/
52-
#define RecursiveCopyKeyValues \
52+
#define CopyKeyValuesFromRecursive \
5353
JustFinishTheDeclaration() {} \
54-
friend void RecursiveCopyKeyValuesHack(KeyValues* pThis, KeyValues& src); \
55-
void RecursiveCopyKeyValues
54+
friend void CopyKeyValuesFromRecursiveHack(KeyValues* pThis, KeyValues& src); \
55+
void CopyKeyValuesFromRecursive
5656

5757
#include "tier1/KeyValues.h"
5858

5959
// Now, remove the replacement, so the friend function can call the member function.
60-
#define RecursiveCopyKeyValues RecursiveCopyKeyValues
61-
void RecursiveCopyKeyValuesHack(KeyValues* pThis, KeyValues& src)
60+
#define CopyKeyValuesFromRecursive CopyKeyValuesFromRecursive
61+
void CopyKeyValuesFromRecursiveHack(KeyValues* pThis, KeyValues& src)
6262
{
63-
pThis->RecursiveCopyKeyValues(src);
63+
pThis->CopyKeyValuesFromRecursive(src);
6464
}
6565

6666

@@ -191,7 +191,7 @@ void export_keyvalues(scope _keyvalues)
191191

192192
.add_property("next_key",
193193
make_function(
194-
&KeyValues::GetNextKey,
194+
GET_METHOD(KeyValues *, KeyValues, GetNextKey),
195195
reference_existing_object_policy()
196196
),
197197
&KeyValues::SetNextKey,
@@ -344,7 +344,7 @@ void export_keyvalues(scope _keyvalues)
344344
)
345345

346346
.def("recursive_copy",
347-
&RecursiveCopyKeyValuesHack,
347+
&CopyKeyValuesFromRecursiveHack,
348348
"Recursively copy the given KeyValues into this KeyValues instance."
349349
)
350350

src/core/modules/steam/orangebox/steam_wrap.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ void export_engine_specific_steamid(scope _steam, T SteamID)
3535
template<class T>
3636
void export_engine_specific_account_type(scope _steam, T AccountType)
3737
{
38-
AccountType.value("P2P_SUPER_SEEDER", k_EAccountTypeP2PSuperSeeder);
3938
}
4039

4140
#endif // _STEAM_WRAP_ORANGEBOX_H

src/makefiles/linux/linux.base.cmake

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ If(SOURCE_ENGINE MATCHES "bms")
5454
Else()
5555
Set(SOURCEPYTHON_LINK_LIBRARIES
5656
"${SOURCEPYTHON_LINK_LIBRARIES}"
57-
${SOURCESDK_LIB}/linux/mathlib_i486.a
58-
${SOURCESDK_LIB}/linux/tier1_i486.a
57+
${SOURCESDK_LIB}/public/linux/mathlib_i486.a
58+
${SOURCESDK_LIB}/public/linux/tier1_i486.a
5959
)
6060
EndIf()
6161

@@ -66,10 +66,8 @@ If(SOURCE_ENGINE MATCHES "orangebox" OR SOURCE_ENGINE MATCHES "l4d2" OR SOURCE_E
6666
# Orangebox has all the tier libraries.
6767
Set(SOURCEPYTHON_LINK_LIBRARIES
6868
"${SOURCEPYTHON_LINK_LIBRARIES}"
69-
${SOURCESDK_LIB}/linux/tier2_i486.a
70-
${SOURCESDK_LIB}/linux/tier3_i486.a
71-
${SOURCESDK_LIB}/linux/libtier0_srv.so
72-
${SOURCESDK_LIB}/linux/libvstdlib_srv.so
69+
${SOURCESDK_LIB}/public/linux/libtier0_srv.so
70+
${SOURCESDK_LIB}/public/linux/libvstdlib_srv.so
7371
)
7472
EndIf()
7573

@@ -113,7 +111,7 @@ Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-conversion-null -Wno-write-strings"
113111
Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -Wno-reorder")
114112

115113
# Others
116-
Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse -msse -m32 -fno-strict-aliasing")
114+
Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse -msse -msse2 -m32 -fno-strict-aliasing")
117115
Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fno-threadsafe-statics -v -fvisibility=hidden")
118116

119117

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
//========= Copyright Valve Corporation, All rights reserved. ============//
2+
//
3+
// Purpose:
4+
//
5+
// $NoKeywords: $
6+
//=============================================================================//
7+
8+
#ifndef IMOVEHELPER_H
9+
#define IMOVEHELPER_H
10+
11+
#ifdef _WIN32
12+
#pragma once
13+
#endif
14+
15+
16+
//-----------------------------------------------------------------------------
17+
// Forward declarations
18+
//-----------------------------------------------------------------------------
19+
20+
enum PLAYER_ANIM;
21+
class IPhysicsSurfaceProps;
22+
class Vector;
23+
struct model_t;
24+
struct cmodel_t;
25+
struct vcollide_t;
26+
class CGameTrace;
27+
enum soundlevel_t;
28+
class CBasePlayer;
29+
30+
//-----------------------------------------------------------------------------
31+
// Purpose: Identifies how submerged in water a player is.
32+
//-----------------------------------------------------------------------------
33+
34+
enum
35+
{
36+
WL_NotInWater=0,
37+
WL_Feet,
38+
WL_Waist,
39+
WL_Eyes
40+
};
41+
42+
43+
//-----------------------------------------------------------------------------
44+
// An entity identifier that works in both game + client dlls
45+
//-----------------------------------------------------------------------------
46+
47+
typedef CBaseHandle EntityHandle_t;
48+
49+
50+
#define INVALID_ENTITY_HANDLE INVALID_EHANDLE
51+
52+
//-----------------------------------------------------------------------------
53+
// Functions the engine provides to IGameMovement to assist in its movement.
54+
//-----------------------------------------------------------------------------
55+
56+
abstract_class IMoveHelper
57+
{
58+
public:
59+
// Call this to set the singleton
60+
static IMoveHelper* GetSingleton( ) { return sm_pSingleton; }
61+
62+
// Methods associated with a particular entity
63+
virtual char const* GetName( EntityHandle_t handle ) const = 0;
64+
65+
// Adds the trace result to touch list, if contact is not already in list.
66+
virtual void ResetTouchList( void ) = 0;
67+
virtual bool AddToTouched( const CGameTrace& tr, const Vector& impactvelocity ) = 0;
68+
virtual void ProcessImpacts( void ) = 0;
69+
70+
// Numbered line printf
71+
virtual void Con_NPrintf( int idx, PRINTF_FORMAT_STRING char const* fmt, ... ) = 0;
72+
73+
// These have separate server vs client impementations
74+
virtual void StartSound( const Vector& origin, int channel, char const* sample, float volume, soundlevel_t soundlevel, int fFlags, int pitch ) = 0;
75+
virtual void StartSound( const Vector& origin, const char *soundname ) = 0;
76+
virtual void PlaybackEventFull( int flags, int clientindex, unsigned short eventindex, float delay, Vector& origin, Vector& angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ) = 0;
77+
78+
// Apply falling damage to m_pHostPlayer based on m_pHostPlayer->m_flFallVelocity.
79+
virtual bool PlayerFallingDamage( void ) = 0;
80+
81+
// Apply falling damage to m_pHostPlayer based on m_pHostPlayer->m_flFallVelocity.
82+
virtual void PlayerSetAnimation( PLAYER_ANIM playerAnim ) = 0;
83+
84+
virtual IPhysicsSurfaceProps *GetSurfaceProps( void ) = 0;
85+
86+
virtual bool IsWorldEntity( const CBaseHandle &handle ) = 0;
87+
88+
// sets the entity being moved
89+
virtual void SetHost( CBasePlayer *host ) = 0;
90+
91+
protected:
92+
// Inherited classes can call this to set the singleton
93+
static void SetSingleton( IMoveHelper* pMoveHelper ) { sm_pSingleton = pMoveHelper; }
94+
95+
// Clients shouldn't call delete directly
96+
virtual ~IMoveHelper() {}
97+
98+
// The global instance
99+
static IMoveHelper* sm_pSingleton;
100+
};
101+
102+
//-----------------------------------------------------------------------------
103+
// Add this to the CPP file that implements the IMoveHelper
104+
//-----------------------------------------------------------------------------
105+
106+
#define IMPLEMENT_MOVEHELPER() \
107+
IMoveHelper* IMoveHelper::sm_pSingleton = 0
108+
109+
//-----------------------------------------------------------------------------
110+
// Call this to set the singleton
111+
//-----------------------------------------------------------------------------
112+
113+
inline IMoveHelper* MoveHelper( )
114+
{
115+
return IMoveHelper::GetSingleton();
116+
}
117+
118+
119+
#endif // IMOVEHELPER_H
-1.69 MB
Binary file not shown.

src/patches/tf2/lib/public/tier1.lib

-4.34 MB
Binary file not shown.

0 commit comments

Comments
 (0)