Skip to content

Commit

Permalink
lua: remove redundant check for always present field in `edicts.istel…
Browse files Browse the repository at this point in the history
…eport()`
  • Loading branch information
alexey-lysiuk committed Nov 16, 2024
1 parent 2f5a364 commit c1a58de
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions Misc/qs_pak/scripts/edicts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -273,25 +273,22 @@ function edicts.isteleport(edict)
return
end

local isad = detectmod() == mods.ARCANE_DIMENSIONS
local target = edict.target
local targetlocation

if target then
local isad = detectmod() == mods.ARCANE_DIMENSIONS

for _, testedict in ipairs(edicts) do
if target == testedict.targetname then
-- Special case for Arcane Dimensions, ad_tears map in particular
-- It uses own teleport target class (info_teleportinstant_dest) which is disabled by default
-- Some teleport destinations were missing despite their valid setup
-- Actual destination coordinates are stored in oldorigin member
if isad and testedict.origin == vec3origin then
targetlocation = testedict.oldorigin
else
targetlocation = testedict.origin
end
break
for _, testedict in ipairs(edicts) do
if target == testedict.targetname then
-- Special case for Arcane Dimensions, ad_tears map in particular
-- It uses own teleport target class (info_teleportinstant_dest) which is disabled by default
-- Some teleport destinations were missing despite their valid setup
-- Actual destination coordinates are stored in oldorigin member
if isad and testedict.origin == vec3origin then
targetlocation = testedict.oldorigin
else
targetlocation = testedict.origin
end
break
end
end

Expand Down

0 comments on commit c1a58de

Please sign in to comment.