feat(Vehicle): Added vehicle god mode

This commit is contained in:
Yimura 2021-08-16 23:11:08 +02:00
parent 68b3289752
commit 117ceaa2cd
No known key found for this signature in database
GPG Key ID: 3D8FF4397E768682
3 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#include "backend/looped/looped.hpp"
namespace big
{
void looped::vehicle_god_mode()
{
if (!g.vehicle.god_mode || g_local_player == nullptr || g_local_player->m_vehicle == nullptr)
return;
if (g_local_player->m_in_vehicle == 0x0)
{
g_local_player->m_vehicle->m_deform_god = 0x8C;
g_local_player->m_vehicle->m_godmode = 0x1;
}
else
{
g_local_player->m_vehicle->m_deform_god = 0x9C;
g_local_player->m_vehicle->m_godmode = 0x0;
}
}
}

View File

@ -79,6 +79,7 @@ struct globals {
bool left_side = false; bool left_side = false;
}; };
bool god_mode = false;
bool horn_boost = false; bool horn_boost = false;
speedo_meter speedo_meter{}; speedo_meter speedo_meter{};
}; };
@ -145,6 +146,7 @@ struct globals {
this->self.frame_flags.fire_ammo = j["self"]["frame_flags"]["fire_ammo"]; this->self.frame_flags.fire_ammo = j["self"]["frame_flags"]["fire_ammo"];
this->self.frame_flags.super_jump = j["self"]["frame_flags"]["super_jump"]; this->self.frame_flags.super_jump = j["self"]["frame_flags"]["super_jump"];
this->vehicle.god_mode = j["vehicle"]["god_mode"];
this->vehicle.horn_boost = j["vehicle"]["horn_boost"]; this->vehicle.horn_boost = j["vehicle"]["horn_boost"];
this->vehicle.speedo_meter.type = (SpeedoMeter)j["vehicle"]["speedo_meter"]["type"]; this->vehicle.speedo_meter.type = (SpeedoMeter)j["vehicle"]["speedo_meter"]["type"];
@ -220,6 +222,7 @@ struct globals {
}, },
{ {
"vehicle", { "vehicle", {
{ "god_mode", this->vehicle.god_mode },
{ "horn_boost", this->vehicle.horn_boost }, { "horn_boost", this->vehicle.horn_boost },
{ {
"speedo_meter", { "speedo_meter", {

View File

@ -17,6 +17,9 @@ namespace big
{ {
if (ImGui::TreeNode("General")) if (ImGui::TreeNode("General"))
{ {
ImGui::Checkbox("God Mode", &g.vehicle.god_mode);
ImGui::SameLine();
if (ImGui::Button("Bring Personal Vehicle")) if (ImGui::Button("Bring Personal Vehicle"))
{ {
QUEUE_JOB_BEGIN_CLAUSE() QUEUE_JOB_BEGIN_CLAUSE()