From 392927ccea04590c18cfd34bdefbf0640146e2e9 Mon Sep 17 00:00:00 2001 From: hydrant Date: Mon, 24 Jun 2019 19:26:26 +0200 Subject: [PATCH] remove vehicle velocity when teleporting --- ReallifeGamemode.Server/Commands/AdminCommands.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 45e951db..9267bd72 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -182,7 +182,11 @@ namespace ReallifeGamemode.Server.Commands return; } //TODO: Als Supporter nur, wenn mit dem Ziel ein offenes Ticket besteht. Ansonsten kein Teleport - if (player.IsInVehicle && player.VehicleSeat == -1) player.Vehicle.Position = target.Position; + if (player.IsInVehicle && player.VehicleSeat == -1) + { + player.Vehicle.Position = target.Position; + NAPI.Entity.SetEntityVelocity(player.Vehicle, new Vector3()); + } else player.Position = target.Position; } @@ -215,7 +219,11 @@ namespace ReallifeGamemode.Server.Commands return; } //TODO: Als Supporter nur, wenn mit dem Ziel ein offenes Ticket besteht. Ansonsten kein Teleport - if (target.IsInVehicle && target.VehicleSeat == -1) target.Vehicle.Position = player.Position; + if (target.IsInVehicle && target.VehicleSeat == -1) + { + target.Vehicle.Position = player.Position; + NAPI.Entity.SetEntityVelocity(target.Vehicle, new Vector3()); + } else target.Position = player.Position; ChatService.SendMessage(target, "Du wurdest von " + player.Name + " teleportiert."); }