src/game/client/components/skins.cpp:142:14: runtime error: -nan is outside the range of representable values of type 'int'
#0 0x55b6bd0f49e1 in CSkins::LoadSkin(char const*, char const*, int, int*) /media/ddnet/src/game/client/components/skins.cpp:142:14
#1 0x55b6bd0f0942 in CSkins::SkinScan(char const*, int, int, void*) /media/ddnet/src/game/client/components/skins.cpp:55:16
#2 0x55b6bcb33928 in fs_listdir /media/ddnet/src/base/system.c:2033:6
#3 0x55b6bcb04024 in CStorage::ListDirectory(int, char const*, int (*)(char const*, int, int, void*), void*) /media/ddnet/src/engine/shared/storage.cpp:316:5
#4 0x55b6bd0f9e2f in CSkins::Refresh() /media/ddnet/src/game/client/components/skins.cpp:222:13
#5 0x55b6bd0f6e33 in CSkins::OnInit() /media/ddnet/src/game/client/components/skins.cpp:194:2
#6 0x55b6bd14c63f in CGameClient::OnInit() /media/ddnet/src/game/client/gameclient.cpp:322:28
#7 0x55b6bcc5f9f8 in CClient::Run() /media/ddnet/src/engine/client/client.cpp:3089:16
#8 0x55b6bcc84b7e in main /media/ddnet/src/engine/client/client.cpp:4341:11
#9 0x7f1144ded151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
#10 0x55b6bc9d1e0d in _start (/media/ddnet/DDNet+0x705e0d)
Purely automatic change. In case of conflict with this change, apply the
other change and rerun the formatting to restore it:
$ python scripts/fix_style.py
2898: Inform players that they are in team already r=heinrich5991 a=def-
2901: Remove failed downloaded files immediately r=heinrich5991 a=def-
Especially skins were only deleted after they were requested again
2908: Don't log skin downloading progress r=heinrich5991 a=def-
since it's not really interesting for most players, as long as things work fine
Co-authored-by: def <dennis@felsin9.de>
Seems to work on first try, I'm somewhat surprised :D
Future ideas (not for this change):
- I haven't checked how the performance impact is of a new skin joining,
might want to move the loading to a separate thread?
- Use the skins from download directory instead of redownloading? Might
want to compare modified time.
- Make all skins load on demand only to save some memory?
Replace `mem_free` by `free`, and `mem_alloc` by `malloc` or `calloc`
(the latter one being used to allocate a zeroed array of elements,
sometimes, this makes a call to `mem_zero` superfluous).
This results in having to remove `mem_stats` which previously recorded
the number of allocations and their size that the Teeworlds code did
directly.
Remove OOM handling in `src/game/client/components/binds.cpp`.
Remove needless copying in the CSV code in
`src/game/client/components/statboard.cpp`.
CDataFileReader::Open(): Check the return status of io_read()
before reading the buffer, to avoid reading uninitialized data
in case the file was shorter than a full header.
CSkins::SkinScan(): Check that the image is high enough.