-- ---------------------------------------------------------------------------
--  Client mirror of this player's character state.
--  Read-only: the server pushes it, nothing here writes back.
-- ---------------------------------------------------------------------------

Core = Core or {}

local character = nil

RegisterNetEvent('rp:core:character', function(data)
  character = data
  TriggerEvent('rp:core:characterChanged', character)
end)

--- Current character, or nil while the player is still at the auth screens.
function Core.Character()
  return character
end

function Core.HasCharacter()
  return character ~= nil
end

exports('getCharacter', Core.Character)
