changes & fixed issues causing game crashes

+ flying speed increased from 15 to 20
+ NolanBehavior_Update hooked
+ fullbright, player speed and fly moved to nolan's update hook
+ added NolanBehaviour parameter to Misc::FullBright function
- fly function removed from misc namespace (this function will be re-added in the near future after further improvements and testing.)
This commit is contained in:
Jadis0x
2024-06-01 19:47:24 +03:00
parent be5f59f1b5
commit 01c16909bf
4 changed files with 97 additions and 95 deletions

View File

@@ -138,54 +138,6 @@ void Misc::InstantWin()
}
}
// This function has not been tested
// This function has not been tested
// This function has not been tested
void Misc::Fly(float speed) {
auto localPlayer = Player::GetLocalPlayer();
if (localPlayer == nullptr) return;
auto nb = Player::GetNolan();
app::Transform* _transform = Unity::Transform::Get(localPlayer);
if (_transform) {
app::Vector3 pos = Unity::Transform::Position(_transform);
if (GetAsyncKeyState('W') & 0x8000) {
pos = pos + (app::Transform_get_forward(_transform, nullptr) * speed * Time_DeltaTime());
}
if (GetAsyncKeyState('S') & 0x8000) {
pos = pos - (app::Transform_get_forward(_transform, nullptr) * speed * Time_DeltaTime());
}
if (GetAsyncKeyState('D') & 0x8000) {
pos = pos + (app::Transform_get_right(_transform, nullptr) * speed * Time_DeltaTime());
}
if (GetAsyncKeyState('A') & 0x8000) {
pos = pos - (app::Transform_get_right(_transform, nullptr) * speed * Time_DeltaTime());
}
if (GetAsyncKeyState(VK_SPACE) & 0x8000) {
pos = pos + (app::Transform_get_up(_transform, nullptr) * speed * Time_DeltaTime());
}
if (GetAsyncKeyState(VK_LCONTROL) & 0x8000) {
pos = pos - (app::Transform_get_up(_transform, nullptr) * speed * Time_DeltaTime());
}
auto component = Unity::GameObject::GetComponentByName(localPlayer, "UltimateCharacterLocomotion");
if (component) {
app::UltimateCharacterLocomotion* locomotion = reinterpret_cast<app::UltimateCharacterLocomotion*>(component);
if (locomotion) {
if (app::UltimateCharacterLocomotion_SetPosition_1 == nullptr) return;
app::UltimateCharacterLocomotion_SetPosition_1(locomotion, pos, false, nullptr);
}
}
}
}
void Misc::CustomizedLobby()
{
@@ -254,16 +206,8 @@ void Misc::RankSpoofer(int value) {
}
}
void Misc::FullBright()
void Misc::FullBright(app::NolanBehaviour* nb)
{
std::string _scene = SceneName();
if (_scene == std::string("Menu")) {
return;
}
app::NolanBehaviour* nb = Player::GetNolan();
if (nb != nullptr) {
app::Light* _flashlight = nb->fields.flashlightSpot;