Skip to content

Commit

Permalink
fix(es_extended/server/modules/commands): only set dim if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenshiin13 committed Dec 6, 2024
1 parent fcdd257 commit be7a448
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions [core]/es_extended/server/modules/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand All @@ -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", {
Expand Down

0 comments on commit be7a448

Please sign in to comment.