Skip to content

Commit 9b749e3

Browse files
committed
feat: Moved and implemented miscellaneous classes
1 parent ff1795c commit 9b749e3

File tree

4 files changed

+85
-42
lines changed

4 files changed

+85
-42
lines changed

src/modules/misc.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*******************************************************************
2+
* @file misc.cpp
3+
* @brief One off or miscellaneous game classes that don't fit into their own module.
4+
* @author Orsell
5+
* @date 06 2025
6+
*********************************************************************/
7+
8+
#include "stdafx.hpp"
9+
#include "modules/misc.hpp"
10+
11+
#include "utils.hpp"
12+
13+
// Redeclaration's for hooks.
14+
REDECL(CUGCFileRequestManager::Update);
15+
REDECL(CPrecipitation::Spawn);
16+
17+
// TODO: Replace unstable hook with byte patch!!
18+
/**
19+
* @brief Stop the UGC manager from automatically download workshop maps. Simply return doing nothing so that nothing gets updated and therefore nothing gets downloaded.
20+
* @warning This makes the game extremely unstable, most of the time crashing, if the plugin is unloaded while the game is running.
21+
*/
22+
DECL_HOOK(CUGCFileRequestManager::Update_Hook, CUGCFileRequestManager_Update);
23+
DETOUR_T(void, CUGCFileRequestManager::Update)
24+
{
25+
return;
26+
}
27+
28+
/**
29+
* @brief func_precipitation entity brushes are bugged where they need to set to the world origin to function properly.
30+
*/
31+
DECL_HOOK(CPrecipitation::Spawn_Hook, CPrecipitation_Spawn);
32+
DETOUR_T(void, CPrecipitation::Spawn)
33+
{
34+
h_CPrecipitation_Spawn.Disable();
35+
CPrecipitation::Spawn(thisPtr);
36+
h_CPrecipitation_Spawn.Enable();
37+
Utils::SetOrigin(static_cast<CBaseEntity*>(thisPtr), Vector(0,0,0), false);
38+
}

src/modules/misc.hpp

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*******************************************************************
2+
* @file misc.hpp
3+
* @brief One off or miscellaneous game classes that don't fit into their own module.
4+
* @author Orsell
5+
* @date 06 2025
6+
*********************************************************************/
7+
8+
#pragma once
9+
10+
#ifndef MISC_HPP
11+
#define MISC_HPP
12+
13+
#include "hook.hpp"
14+
#include "platform.hpp"
15+
16+
class CUGCFileRequestManager
17+
{
18+
public: // MARK: CUGCFileRequestManager Public Members
19+
#pragma region Public Members
20+
21+
// Workshop download stopping hooks.
22+
DECL_DETOUR_T(void, Update);
23+
24+
#pragma endregion
25+
26+
private: // MARK: CUGCFileRequestManager Private Members
27+
#pragma region Private Members
28+
#pragma endregion
29+
};
30+
31+
class CPrecipitation
32+
{
33+
public: // MARK: CPrecipitation Public Members
34+
#pragma region Public Members
35+
36+
// func_precipitation origin fix hook.
37+
DECL_DETOUR_T(void, Spawn);
38+
39+
#pragma endregion
40+
41+
private: // MARK: CPrecipitation Private Members
42+
#pragma region Private Members
43+
#pragma endregion
44+
};
45+
46+
47+
#endif

src/sdk.cpp

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/sdk.hpp

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)