* Add player UCID to event data structure (for multi-player)
This commit is contained in:
Applevangelist
2023-11-07 11:07:28 +01:00
parent c765070401
commit 7f650913d9
3 changed files with 26 additions and 7 deletions

View File

@@ -470,11 +470,9 @@ end
-- @return #number PlayerID or nil
function NET:GetPlayerIDByName(Name)
if not Name then return nil end
local playerList = self:GetPlayerList()
self:T({playerList})
local playerList = net.get_player_list()
for i=1,#playerList do
local playerName = net.get_name(i)
self:T({playerName})
if playerName == Name then
return playerList[i]
end