6094: Check if ghost is really used bcs IntsToStr returns weird stuff for 0… r=def- a=Jupeyy

… integers

--- ignore whitespaces

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
This commit is contained in:
bors[bot] 2022-12-05 19:34:43 +00:00 committed by GitHub
commit 2dcef1685b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -671,6 +671,8 @@ void CGhost::RefindSkin()
{
char aSkinName[64];
for(auto &Ghost : m_aActiveGhosts)
{
if(!Ghost.Empty())
{
IntsToStr(&Ghost.m_Skin.m_Skin0, 6, aSkinName);
if(aSkinName[0] != '\0')
@ -683,6 +685,9 @@ void CGhost::RefindSkin()
pRenderInfo->m_SkinMetrics = pSkin->m_Metrics;
}
}
}
if(!m_CurGhost.Empty())
{
IntsToStr(&m_CurGhost.m_Skin.m_Skin0, 6, aSkinName);
if(aSkinName[0] != '\0')
{
@ -694,3 +699,4 @@ void CGhost::RefindSkin()
pRenderInfo->m_SkinMetrics = pSkin->m_Metrics;
}
}
}