Skip to content
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
2 changes: 1 addition & 1 deletion product.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.0
1.3.1
9 changes: 2 additions & 7 deletions src/extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,8 @@ IForward *g_pPassFwd = NULL;

int gSetCollisionSolverHookId, gShouldCollideHookId;

#if defined(__linux__) && defined(__i386__)
CDetour* PassServerEntityFilterFuncDetour;
__attribute__((regparm(2))) bool (*PassServerEntityFilterFunc_Actual)(const IHandleEntity*, const IHandleEntity*);
__attribute__((regparm(2))) bool PassServerEntityFilterFunc(const IHandleEntity* pTouch, const IHandleEntity* pPass)
#else
DETOUR_DECL_STATIC2( PassServerEntityFilterFunc, bool, const IHandleEntity *, pTouch, const IHandleEntity *, pPass )
#endif

DETOUR_CUSTOM_STATIC2( PassServerEntityFilterFunc, bool, const IHandleEntity *, pTouch, const IHandleEntity *, pPass )
{
if ( g_pPassFwd->GetFunctionCount() == 0 )
return DETOUR_STATIC_CALL( PassServerEntityFilterFunc )( pTouch, pPass );
Expand Down
16 changes: 16 additions & 0 deletions src/extension.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,21 @@ inline const CBaseEntity *UTIL_EntityFromEntityHandle( const IHandleEntity *pCon
return pUnk->GetBaseEntity();
}

#define DETOUR_DECL_STATIC2_REGPARM(name, ret, p1type, p1name, p2type, p2name) \
ret (*name##_Actual)(p1type, p2type) __attribute__((regparm(2))) = NULL; \
ret name(p1type p1name, p2type p2name) __attribute__((regparm(2)))

#define DETOUR_DECL_STATIC2_FASTCALL(name, ret, p1type, p1name, p2type, p2name) \
ret (__fastcall *name##_Actual)(p1type, p2type) = NULL; \
ret __fastcall name(p1type p1name, p2type p2name)


#if SOURCE_ENGINE == SE_TF2 && defined(PLATFORM_LINUX) && defined(__i386__)
#define DETOUR_CUSTOM_STATIC2 DETOUR_DECL_STATIC2_REGPARM
#elif SOURCE_ENGINE == SE_CSGO && defined(PLATFORM_WINDOWS)
#define DETOUR_CUSTOM_STATIC2 DETOUR_DECL_STATIC2_FASTCALL
#else
#define DETOUR_CUSTOM_STATIC2 DETOUR_DECL_STATIC2
#endif

#endif // _INCLUDE_COLLISIONHOOK_EXTENSION_H_
4 changes: 2 additions & 2 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

#define SM_BUILD_TAG "-manual"
#define SM_BUILD_UNIQUEID "[MANUAL BUILD]"
#define SM_VERSION "1.3.0"
#define SM_VERSION "1.3.1"
#define SM_FULL_VERSION SM_VERSION SM_BUILD_TAG
#define SM_FILE_VERSION 1,3,0,0
#define SM_FILE_VERSION 1,3,1,0

#endif

Expand Down
Loading