refactor: TabTeleport moved personal vehicle global to util header

This commit is contained in:
Yimura 2022-01-09 01:10:38 +01:00
parent 1074802d8c
commit bc6cb46faf
2 changed files with 13 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#include "main_tabs.hpp"
#include "fiber_pool.hpp"
#include "script_global.hpp"
#include "util/globals.hpp"
#include "util/teleport.hpp"
#include "util/vehicle.hpp"
@ -47,7 +47,7 @@ namespace big
{
QUEUE_JOB_BEGIN_CLAUSE()
{
Vehicle veh = *script_global(2810287).at(298).as<Vehicle*>();
Vehicle veh = globals::get_personal_vehicle();
if (ENTITY::IS_ENTITY_DEAD(veh, false)) return notify::above_map("Invalid vehicle handle...");
Vector3 location = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true);
@ -58,7 +58,7 @@ namespace big
if (ImGui::Button("Teleport to Personal Vehicle"))
{
Vehicle veh = *script_global(2810287).at(298).as<Vehicle*>();
Vehicle veh = globals::get_personal_vehicle();
if (ENTITY::IS_ENTITY_DEAD(veh, false)) return notify::above_map("Invalid vehicle handle...");
teleport::to_coords(

View File

@ -0,0 +1,10 @@
#pragma once
#include "script_global.hpp"
namespace big::globals
{
inline Vehicle get_personal_vehicle()
{
return *script_global(2810287).at(298).as<Vehicle*>();
}
}