Skip to content

Commit 7fe4d68

Browse files
authored
Merge pull request #505 from omegacord/patch-1
Fix ix.util.GetAddress()
2 parents c5338b2 + d914668 commit 7fe4d68

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

gamemode/core/sh_util.lua

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -209,18 +209,7 @@ end
209209

210210
-- Returns the address:port of the server.
211211
function ix.util.GetAddress()
212-
local address = tonumber(GetConVarString("hostip"))
213-
214-
if (!address) then
215-
return "127.0.0.1"..":"..GetConVarString("hostport")
216-
end
217-
218-
local ip = {}
219-
ip[1] = bit.rshift(bit.band(address, 0xFF000000), 24)
220-
ip[2] = bit.rshift(bit.band(address, 0x00FF0000), 16)
221-
ip[3] = bit.rshift(bit.band(address, 0x0000FF00), 8)
222-
ip[4] = bit.band(address, 0x000000FF)
223-
return table.concat(ip, ".")..":"..GetConVarString("hostport")
212+
return game.GetIPAddress()
224213
end
225214

226215
--- Returns a cached copy of the given material, or creates and caches one if it doesn't exist. This is a quick helper function

0 commit comments

Comments
 (0)