From be7a448feca5b5b513830af68528be8f5179913d Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Fri, 6 Dec 2024 10:42:08 +0100 Subject: [PATCH] fix(es_extended/server/modules/commands): only set dim if needed --- [core]/es_extended/server/modules/commands.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/[core]/es_extended/server/modules/commands.lua b/[core]/es_extended/server/modules/commands.lua index 7df37401d..628e85ea8 100644 --- a/[core]/es_extended/server/modules/commands.lua +++ b/[core]/es_extended/server/modules/commands.lua @@ -593,9 +593,12 @@ ESX.RegisterCommand( "admin", function(xPlayer, args) local targetCoords = args.playerId.getCoords() + local srcDim = GetPlayerRoutingBucket(xPlayer.source) local targetDim = GetPlayerRoutingBucket(args.playerId.source) - SetPlayerRoutingBucket(xPlayer.source, targetDim) + if srcDim ~= targetDim then + SetPlayerRoutingBucket(xPlayer.source, targetDim) + end xPlayer.setCoords(targetCoords) if Config.AdminLogging then ESX.DiscordLogFields("UserActions", "Admin Teleport /goto Triggered!", "pink", { @@ -622,9 +625,12 @@ ESX.RegisterCommand( function(xPlayer, args) local targetCoords = args.playerId.getCoords() local playerCoords = xPlayer.getCoords() + local targetDim = GetPlayerRoutingBucket(args.playerId.source) local srcDim = GetPlayerRoutingBucket(xPlayer.source) - SetPlayerRoutingBucket(args.playerId.source, srcDim) + if targetDim ~= srcDim then + SetPlayerRoutingBucket(args.playerId.source, srcDim) + end args.playerId.setCoords(playerCoords) if Config.AdminLogging then ESX.DiscordLogFields("UserActions", "Admin Teleport /bring Triggered!", "pink", {