-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMQMountClassicModels.cpp
More file actions
60 lines (53 loc) · 1.21 KB
/
MQMountClassicModels.cpp
File metadata and controls
60 lines (53 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <mq/Plugin.h>
PreSetup("MQMountClassicModels");
PLUGIN_VERSION(0.1);
#ifdef ROF2EMU
#define RaceCannotMount_x 0x58DDE0
#endif
#ifdef RaceCannotMount_x
INITIALIZE_EQGAME_OFFSET(RaceCannotMount);
#endif
class RaceCannotMountHook
{
public:
DETOUR_TRAMPOLINE_DEF(bool, RaceCannotMount_Trampoline, ())
bool RaceCannotMount_Detour()
{
switch(pLocalPlayer->GetRace())
{
case EQR_HUMAN:
case EQR_BARBARIAN:
case EQR_ERUDITE:
case EQR_ELF:
case EQR_HIGH_ELF:
case EQR_DARK_ELF:
case EQR_HALF_ELF:
case EQR_DWARF:
case EQR_TROLL:
case EQR_OGRE:
case EQR_HALFLING:
case EQR_GNOME:
case EQR_IKSAR:
case EQR_VAHSHIR:
return false;
default:
return RaceCannotMount_Trampoline();
}
}
};
PLUGIN_API void InitializePlugin()
{
DebugSpewAlways("MQMountClassicModels::Initializing version %f", MQ2Version);
#ifdef RaceCannotMount_x
EzDetour(RaceCannotMount, &RaceCannotMountHook::RaceCannotMount_Detour, &RaceCannotMountHook::RaceCannotMount_Trampoline);
#else
DebugSpewAlways("MQMountClassicModels::Not enabled for this client");
#endif
}
PLUGIN_API void ShutdownPlugin()
{
DebugSpewAlways("MQMountClassicModels::Shutting down");
#ifdef RaceCannotMount_x
RemoveDetour(RaceCannotMount);
#endif
}