Hook triggers
This commit is contained in:
parent
2b0529ab7d
commit
bb979639d6
@ -740,6 +740,24 @@ namespace Components
|
|||||||
Utils::Hook::Call<void(Game::gentity_s*, int, int)>(0x408910)(ent, unk, unk2);
|
Utils::Hook::Call<void(Game::gentity_s*, int, int)>(0x408910)(ent, unk, unk2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Maps::SV_SetTriggerModelHook(Game::gentity_s* ent) {
|
||||||
|
|
||||||
|
//Logger::Print("SETTRIGGERMODELHOOK %s\n", ent->target);
|
||||||
|
std::string classname = Game::SL_ConvertToString(ent->script_classname);
|
||||||
|
std::string targetname = Game::SL_ConvertToString(ent->targetname);
|
||||||
|
//std::string test = "";
|
||||||
|
//if (ent->padding_short) {
|
||||||
|
// test = Game::SL_ConvertToString(ent->padding_short);
|
||||||
|
//}
|
||||||
|
|
||||||
|
return Utils::Hook::Call<bool(Game::gentity_s*)>(0x5050C0)(ent);
|
||||||
|
}
|
||||||
|
|
||||||
|
int16 Maps::CM_TriggerModelBounds(int modelPointer, Game::Bounds* bounds) {
|
||||||
|
Game::MapEnts* ents = *reinterpret_cast<Game::MapEnts**>(0x1AA651C);
|
||||||
|
return Utils::Hook::Call<int16(int, Game::Bounds*)>(0x4416C0)(modelPointer, bounds);
|
||||||
|
}
|
||||||
|
|
||||||
Maps::Maps()
|
Maps::Maps()
|
||||||
{
|
{
|
||||||
Dvar::OnInit([]()
|
Dvar::OnInit([]()
|
||||||
@ -779,6 +797,14 @@ namespace Components
|
|||||||
Utils::Hook(0x5EE577, Maps::G_SpawnTurretHook, HOOK_CALL).install()->quick();
|
Utils::Hook(0x5EE577, Maps::G_SpawnTurretHook, HOOK_CALL).install()->quick();
|
||||||
Utils::Hook(0x44A4D5, Maps::G_SpawnTurretHook, HOOK_CALL).install()->quick();
|
Utils::Hook(0x44A4D5, Maps::G_SpawnTurretHook, HOOK_CALL).install()->quick();
|
||||||
|
|
||||||
|
// Check trigger models
|
||||||
|
Utils::Hook(0x5FC0F1, Maps::SV_SetTriggerModelHook, HOOK_CALL).install()->quick();
|
||||||
|
Utils::Hook(0x5FC2671, Maps::SV_SetTriggerModelHook, HOOK_CALL).install()->quick();
|
||||||
|
|
||||||
|
Utils::Hook(0x5050D4, Maps::CM_TriggerModelBounds, HOOK_CALL).install()->quick();
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
//#define SORT_SMODELS
|
//#define SORT_SMODELS
|
||||||
#if !defined(DEBUG) || !defined(SORT_SMODELS)
|
#if !defined(DEBUG) || !defined(SORT_SMODELS)
|
||||||
// Don't sort static models
|
// Don't sort static models
|
||||||
|
@ -120,5 +120,7 @@ namespace Components
|
|||||||
static void SetSpecularStub1();
|
static void SetSpecularStub1();
|
||||||
static void SetSpecularStub2();
|
static void SetSpecularStub2();
|
||||||
static void G_SpawnTurretHook(Game::gentity_s* ent, int unk, int unk2);
|
static void G_SpawnTurretHook(Game::gentity_s* ent, int unk, int unk2);
|
||||||
|
static bool SV_SetTriggerModelHook(Game::gentity_s* ent);
|
||||||
|
static int16 CM_TriggerModelBounds(int brushModelPointer, Game::Bounds* bounds);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user