feat(Vehicle): Notify when failing to take control

This commit is contained in:
Yimura 2021-09-21 13:39:15 +02:00
parent b1c9dd5025
commit 80f5d727ff
No known key found for this signature in database
GPG Key ID: 3D8FF4397E768682

View File

@ -6,14 +6,18 @@
#include "notify.hpp"
#include "pointers.hpp"
#include "script.hpp"
#include "teleport.hpp"
namespace big::vehicle
{
inline void bring(Vehicle veh, Vector3 location, bool put_in = true)
{
entity::take_control_of(veh);
Vector3 vecVehicleLocation = ENTITY::GET_ENTITY_COORDS(veh, true);
teleport::load_ground_at_3dcoord(vecVehicleLocation);
ENTITY::SET_ENTITY_COORDS(veh, location.x, location.y, location.z + 1.f, 0, 0, 0, 1);
if (!entity::take_control_of(veh))
notify::above_map("Failed to take control of remote vehicle.");
ENTITY::SET_ENTITY_COORDS(veh, location.x, location.y, location.z + 1.f, 0, 0, 0, 0);
if (put_in)
{