m_IsVanillaSkin
in CSkin
in src/game/client/component/skins.hm_OrgTexture
texture is setm_IsVanillaSkin
m_IsVanilla
, it's already in the CSkin
structm_OrgTexture
in src/game/client/components/skins.cppCSkin
is initialized herem_IsVanilla
m_DummySkin.m_IsVanilla = …
OnInit
function?CSkin
thereCSkin
do there?m_aSkins.add(DummySkin);
DummySkin.m_IsVanilla
bool
can only be true
or false
m_IsVanilla
to true
m_OrgTexture
if(g_Config.m_ClVanillaSkinsOnly && !IsVanillaSkin(aFilenameWithoutPng))
{
return 0;
}
m_OrgTexture
occurence Skin.m_OrgTexture = pSelf->Graphics()->LoadTextureRaw(Info.m_Width, Info.m_Height, Info.m_Format, Info.m_pData, Info.m_Format, 0);
SkinScan()
Skin.m_OrgTexture = pSelf->Graphics()->LoadTextureRaw(Info.m_Width, Info.m_Height, Info.m_Format, Info.m_pData, Info.m_Format, 0);
this is nextm_IsVanilla
if
if
Skin.m_IsVanilla = true;
else
Skin.m_IsVanilla = false;
Skin.m_IsVanilla = g_Config.m_ClVanillaSkinsOnly && !IsVanillaSkin(aFilenameWithoutPng)
Skin.m_IsVanilla = IsVanillaSkin(aFilenameWithoutPng)
g_Config.m_ClVanillaSkinsOnly
CSkin Skin;
m_IsVanilla
thing if(g_Config.m_ClVanillaSkinsOnly && !s->m_IsVanilla)
continue;
ive added thiss_InitSkinList = true;
static const char *VANILLA_SKINS[] = {"bluekitty", "bluestripe", "brownbear",
"cammo", "cammostripes", "coala", "default", "limekitty",
"pinky", "redbopp", "redstripe", "saddo", "toptri",
"twinbop", "twintri", "warpaint", "x_ninja"};
%s
in dbg_msg
and str_format
"?str_format([…], "%s_%s", YourParameter, VANILLA_SKINS[3])
-1
if the skin cannot be foundFind
const CSkins::CSkin *pOwnSkin = m_pClient->m_pSkins->Get(m_pClient->m_pSkins->Find(Skin));
// find new skin
m_aClients[ClientID].m_SkinID = g_GameClient.m_pSkins->Find(m_aClients[ClientID].m_aSkinName);
if(m_aClients[ClientID].m_SkinID < 0)
{
m_aClients[ClientID].m_SkinID = g_GameClient.m_pSkins->Find("default");
if(m_aClients[ClientID].m_SkinID < 0)
m_aClients[ClientID].m_SkinID = 0;
}
const CSkins::CSkin *pOwnSkin = m_pClient->m_pSkins->Get(m_pClient->m_pSkins->Find(Skin));
Get
function gets called with whatever we return from m_pSkins->Find
m_pSkins->Get(-1)
Get
function of CSkins
-1
therereturn &m_aSkins[max(0, Index%m_aSkins.size())];
max(x, y)
gives the larger number of x
and y
return &m_aSkins[max(0, Index)];
max(0, Index)
Index
Get
function to return the default skin if it gets passed -1
-1
in Get
"default"
int CCollision::IntersectLineTeleHook(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pOutBeforeCollision, int *pTeleNr)
whats that?m_SkinID
of m_aClients[ClientID].m_SkinID = g_GameClient.m_pSkins->Find(m_aClients[ClientID].m_aSkinName);
and select something like "go to definition"m_SkinID
?m_SkinID
there: int m_SkinID;
in struct CClientData
int
of some unrelated structureint
variable insteadGet
function when our bug triggers?Index
?if
if(Index == -1)
"default"
, how do we do this? @fokkonautFind("default")
return?Index
to Find("default")
in that if, and skins that were not found will be replaced by the default skinconst CSkins::CSkin *CSkins::Get(int Index)
Get
int
and returns a const CSkins::CSkin *
const CSkins::CSkin *
is)int
and return a const CSkins::CSkin *
if(Index == -1)
{
// something with Find("default")
}
return &m_aSkins[max(0, Index%m_aSkins.size())];
-1
if(Index == -1)
{
Index = Find("default");
}
return &m_aSkins[max(0, Index%m_aSkins.size())];
index < -1
is a bug anyway ^^ (edited)"default"
skin cannot be found"default"
cannot be found if(m_aClients[ClientID].m_SkinID < 0)
m_aClients[ClientID].m_SkinID = 0;
if(Index < 0)
{
Index = Find("default");
if (Index < 0)
Index = 0;
}
return &m_aSkins[max(0, Index%m_aSkins.size())];
max
nowreturn &m_aSkins[Index % m_aSkins.size()];
if(m_aClients[ClientID].m_SkinID < 0)
{
m_aClients[ClientID].m_SkinID = g_GameClient.m_pSkins->Find("default");
if(m_aClients[ClientID].m_SkinID < 0)
m_aClients[ClientID].m_SkinID = 0;
}
remove that because we have it in Get? if(SkinId < 0)
{
SkinId = m_pClient->m_pSkins->Find("default");
if(SkinId < 0)
SkinId = 0;
}
m_IsVanilla
as wellm_OrgTexture
(same in the header file), so that initialization order is consistent!IsVanillaSkin(m_aSkins[i].m_aName)
by !m_aSkins[i].m_IsVanilla
struct CSkin
{
bool m_IsVanilla;
int m_OrgTexture;
int m_ColorTexture;
char m_aName[24];
vec3 m_BloodColor;
bool operator<(const CSkin &Other) { return str_comp(m_aName, Other.m_aName) < 0; }
};
CSkin Skin;
Skin.m_IsVanilla = IsVanillaSkin(aFilenameWithoutPng);
Skin.m_OrgTexture = pSelf->Graphics()->LoadTextureRaw(Info.m_Width, Info.m_Height, Info.m_Format, Info.m_pData, Info.m_Format, 0);
[section]
line (edited)if(Temp.x > 0 && ((pCharCore->m_TileIndex == TILE_STOP && pCharCore->m_TileFlags == ROTATION_270) || (pCharCore->m_TileIndexL == TILE_STOP && pCharCore->m_TileFlagsL == ROTATION_270) || (pCharCore->m_TileIndexL == TILE_STOPS && (pCharCore->m_TileFlagsL == ROTATION_90 || pCharCore->m_TileFlagsL ==ROTATION_270)) || (pCharCore->m_TileIndexL == TILE_STOPA) || (pCharCore->m_TileFIndex == TILE_STOP && pCharCore->m_TileFFlags == ROTATION_270) || (pCharCore->m_TileFIndexL == TILE_STOP && pCharCore->m_TileFFlagsL == ROTATION_270) || (pCharCore->m_TileFIndexL == TILE_STOPS && (pCharCore->m_TileFFlagsL == ROTATION_90 || pCharCore->m_TileFFlagsL == ROTATION_270)) || (pCharCore->m_TileFIndexL == TILE_STOPA) || (pCharCore->m_TileSIndex == TILE_STOP && pCharCore->m_TileSFlags == ROTATION_270) || (pCharCore->m_TileSIndexL == TILE_STOP && pCharCore->m_TileSFlagsL == ROTATION_270) || (pCharCore->m_TileSIndexL == TILE_STOPS && (pCharCore->m_TileSFlagsL == ROTATION_90 || pCharCore->m_TileSFlagsL == ROTATION_270)) || (pCharCore->m_TileSIndexL == TILE_STOPA)))