mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-12 19:18:20 +00:00
Refactor json parser usage in CServerInfo2::FromJsonRaw
This commit is contained in:
parent
ca1bec5bac
commit
2973eee036
|
@ -142,7 +142,7 @@ bool CServerInfo2::FromJsonRaw(CServerInfo2 *pOut, const json_value *pJson)
|
||||||
if(SkinName.type == json_string)
|
if(SkinName.type == json_string)
|
||||||
{
|
{
|
||||||
HasSkin = true;
|
HasSkin = true;
|
||||||
str_copy(pClient->m_aSkin, json_string_get(&SkinName));
|
str_copy(pClient->m_aSkin, SkinName.u.string.ptr);
|
||||||
// if skin json value existed, then always at least default to "default"
|
// if skin json value existed, then always at least default to "default"
|
||||||
if(pClient->m_aSkin[0] == '\0')
|
if(pClient->m_aSkin[0] == '\0')
|
||||||
str_copy(pClient->m_aSkin, "default");
|
str_copy(pClient->m_aSkin, "default");
|
||||||
|
@ -150,8 +150,8 @@ bool CServerInfo2::FromJsonRaw(CServerInfo2 *pOut, const json_value *pJson)
|
||||||
if(SkinBodyColor.type == json_integer && SkinFeetColor.type == json_integer)
|
if(SkinBodyColor.type == json_integer && SkinFeetColor.type == json_integer)
|
||||||
{
|
{
|
||||||
pClient->m_CustomSkinColors = true;
|
pClient->m_CustomSkinColors = true;
|
||||||
pClient->m_CustomSkinColorBody = json_int_get(&SkinBodyColor);
|
pClient->m_CustomSkinColorBody = SkinBodyColor.u.integer;
|
||||||
pClient->m_CustomSkinColorFeet = json_int_get(&SkinFeetColor);
|
pClient->m_CustomSkinColorFeet = SkinFeetColor.u.integer;
|
||||||
}
|
}
|
||||||
// else set custom colors off
|
// else set custom colors off
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue