From 868a6786188bafab2b83c742867bd7b2a78630a7 Mon Sep 17 00:00:00 2001 From: Rxann <80224521+Rxann@users.noreply.github.com> Date: Fri, 9 Aug 2024 23:11:39 -0400 Subject: [PATCH] fix file deletion merge issue --- src/game/features/self/SpawnBountyWagon.cpp | 32 ----------------- src/game/features/self/SpawnHuntingWagon.cpp | 36 -------------------- src/util/VehicleSpawner.cpp | 30 ---------------- 3 files changed, 98 deletions(-) delete mode 100644 src/game/features/self/SpawnBountyWagon.cpp delete mode 100644 src/game/features/self/SpawnHuntingWagon.cpp delete mode 100644 src/util/VehicleSpawner.cpp diff --git a/src/game/features/self/SpawnBountyWagon.cpp b/src/game/features/self/SpawnBountyWagon.cpp deleted file mode 100644 index 3fc9269f..00000000 --- a/src/game/features/self/SpawnBountyWagon.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "core/commands/Command.hpp" -#include "core/frontend/Notifications.hpp" -#include "game/backend/Self.hpp" -#include "util/VehicleSpawner.hpp" - - -namespace YimMenu::Features -{ - // TODO: this should not exist - class SpawnBountyWagon : public Command - { - using Command::Command; - - virtual void OnCall() override - { - Vector3 dim1, dim2; - MISC::GET_MODEL_DIMENSIONS(MISC::GET_HASH_KEY("wagonarmoured01x"), &dim1, &dim2); - float offset = dim2.y * 1.6; - - Vector3 dir = ENTITY::GET_ENTITY_FORWARD_VECTOR(Self::GetPed().GetHandle()); - float rot = Self::GetPed().GetRotation(0).z; - Vector3 pos = Self::GetPed().GetPosition(); - - int handle = SpawnVehicle("wagonarmoured01x", Vector3{pos.x + (dir.x * offset), pos.y + (dir.y * offset), pos.z}, rot); - - VEHICLE::SET_VEHICLE_HAS_BEEN_OWNED_BY_PLAYER(handle, true); - VEHICLE::SET_PED_OWNS_VEHICLE(Self::GetPed().GetHandle(), handle); - } - }; - - static SpawnBountyWagon _SpawnBountyWagon{"spawnbountywagon", "Spawn Bounty Wagon", "Spawns the bounty hunter wagon into the game."}; -} \ No newline at end of file diff --git a/src/game/features/self/SpawnHuntingWagon.cpp b/src/game/features/self/SpawnHuntingWagon.cpp deleted file mode 100644 index dbccbc5f..00000000 --- a/src/game/features/self/SpawnHuntingWagon.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "core/commands/Command.hpp" -#include "core/frontend/Notifications.hpp" -#include "game/backend/Self.hpp" -#include "util/VehicleSpawner.hpp" - - -namespace YimMenu::Features -{ - // TODO: this should not exist - class SpawnHuntingWagon : public Command - { - using Command::Command; - - virtual void OnCall() override - { - Vector3 dim1, dim2; - MISC::GET_MODEL_DIMENSIONS(MISC::GET_HASH_KEY("huntercart01"), &dim1, &dim2); - float offset = dim2.y * 1.6; - - Vector3 dir = ENTITY::GET_ENTITY_FORWARD_VECTOR(Self::GetPed().GetHandle()); - float rot = Self::GetPed().GetRotation(0).z; - Vector3 pos = Self::GetPed().GetPosition(); - - int handle = SpawnVehicle("huntercart01", - Vector3{pos.x + (dir.x * offset), pos.y + (dir.y * offset), pos.z}, - rot); - - PLAYER::_SET_PLAYER_HUNTING_WAGON(Self::GetPlayer().GetId(), handle); - VEHICLE::SET_VEHICLE_HAS_BEEN_OWNED_BY_PLAYER(handle, true); - VEHICLE::SET_PED_OWNS_VEHICLE(Self::GetPed().GetHandle(), handle); - Notifications::Show("Vehicle Spawner", "Wagon Spawned!", NotificationType::Success); - }; - }; - - static SpawnHuntingWagon _SpawnHuntingWagon{"spawnhuntingwagon", "Spawn Hunting Wagon", "Spawns the hunting wagon for the trader role."}; -} \ No newline at end of file diff --git a/src/util/VehicleSpawner.cpp b/src/util/VehicleSpawner.cpp deleted file mode 100644 index 995f6ca2..00000000 --- a/src/util/VehicleSpawner.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "VehicleSpawner.hpp" - -namespace YimMenu -{ - int SpawnVehicle(std::string modelName, Vector3 coords, float rotation, bool notNeeded) - { - Hash model = MISC::GET_HASH_KEY(modelName.c_str()); - - STREAMING::REQUEST_MODEL(model, 0); - for (int i = 0; i < 30 && !STREAMING::HAS_MODEL_LOADED(model); i++) - { - STREAMING::REQUEST_MODEL(model, false); - ScriptMgr::Yield(); - } - - if (STREAMING::IS_MODEL_IN_CDIMAGE(model) && STREAMING::IS_MODEL_A_VEHICLE(model)) - { - Vehicle veh = VEHICLE::CREATE_VEHICLE(model, coords.x, coords.y, coords.z, rotation, TRUE, TRUE, FALSE, 0); - - ScriptMgr::Yield(); - VEHICLE::SET_VEHICLE_ON_GROUND_PROPERLY(veh, 0); - ENTITY::SET_ENTITY_VISIBLE(veh, TRUE); - if (notNeeded) - ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&veh); - STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(model); - return veh; - } - return 0; - } -}; \ No newline at end of file