3100: Fix offline client that is not in menu r=heinrich5991 a=Jupeyy
E.g. popups like "ddnet-info.json" failed will cause weird NaN glitches, bcs the impl relys on ChangePosition to clean movetime and animation start
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
3101: Fix hookchains r=heinrich5991 a=Jupeyy
Its already increased by the for loop.
Might have made the hook shorter(for very very long hooks) the past 3 years xd
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
To be friendly to other implementors of the format, the CRC field is now
zeroed out instead of completely gone.
Drop support for v2 and v3 of the ghost format, the ghost files should
have been automatically converted by the client already.
/media/ddnet/src/engine/shared/dilate.cpp:32:22: warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage [clang-analyzer-core.uninitialized.Assign]
/media/ddnet/src/game/client/animstate.cpp:54:27: warning: The left operand of '*' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
pSeq->m_X += pAdded->m_X * Amount;
^
/media/ddnet/src/game/editor/auto_map.cpp:94:17: warning: Called C++ object pointer is null [clang-analyzer-core.CallAndMessage]
int RunID = pCurrentConf->m_aRuns.add(NewRun);
^
/media/ddnet/src/engine/server/sql_string_helpers.cpp:74:3: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
and mark some false positives
/media/ddnet/src/engine/client/backend_sdl.cpp:329:30: warning: Call to 'malloc' has an allocation size of 0 bytes [clang-analyzer-optin.portability.UnixAPI]
/media/ddnet/src/game/editor/auto_map.cpp:433:1: warning: Potential leak of memory pointed to by 'pUpdateLayer' [clang-analyzer-cplusplus.NewDeleteLeaks]
}
^
[81/219] Building CXX object CMakeFiles/game-shared.dir/src/game/collision.cpp.o
/media/ddnet/src/game/collision.cpp:1197:2: warning: Variable 'f' with floating point type 'float' should not be used as a loop counter [clang-analyzer-security.FloatLoopCounter]
for(float f = 0; f < d; f++)
^
The actual work will be fixing those or at least
NOLINT(clang-analyzer-optin.cplusplus.VirtualCall) them so we can enable
this. Disable checks that we don't want.
Exclude external directory from clang-tidy.
3089: Fix out of bounds access in snapshot delta handling r=heinrich5991 a=axblk
Same as 293209e722 + c87a7b438f in 0.7
Co-authored-by: Redix <redix@hotmail.de>
3086: Fix 2 leaks in CServerBrowser r=def- a=Learath2
The only leaks reported by ASan that are allocated by us. There is one other by SDL and one by X11.
Co-authored-by: Learath2 <learath2@gmail.com>
3083: Make menu background camera impl more robust r=def- a=Jupeyy
The vanilla code isnt really robust against short distances, hope this fixes almost all edge cases
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
3078: Make initial borderless work again r=heinrich5991 a=def-
Mistakenly disabled in https://github.com/ddnet/ddnet/pull/1418
Co-authored-by: def <dennis@felsin9.de>
3068: Fix alignment issues in CCommandBuffer r=def- a=Learath2
Though I prefer this version I also made one keeping the old ugly pointer arithmetic cb61356105
Feel free to take whichever. Supersedes #3061
Co-authored-by: Learath2 <learath2@gmail.com>
3066: Disallow more commands with testing mode r=def- a=heinrich5991
Also show some useful error message
Supersedes #2778.
Co-authored-by: Andrii <bannzay3@gmail.com>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
src/game/teamscore.cpp:27:78: runtime error: index -1 out of bounds for type 'int const[64]'
#0 0xf5b948 in CTeamsCore::CanKeepHook(int, int) const src/game/teamscore.cpp:27
#1 0xf46fe1 in CCharacterCore::Tick(bool) src/game/gamecore.cpp:325
#2 0xaf7366 in CGameClient::DetectStrongHook() src/game/client/gameclient.cpp:2441
#3 0xadd734 in CGameClient::UpdatePrediction() src/game/client/gameclient.cpp:2249
#4 0xad6e17 in CGameClient::OnNewSnapshot() src/game/client/gameclient.cpp:1675
#5 0x522d55 in CClient::Update() src/engine/client/client.cpp:2767
#6 0x5333e4 in CClient::Run() src/engine/client/client.cpp:3237
#7 0x557fda in main src/engine/client/client.cpp:4341
#8 0x7f55e8c75cc9 in __libc_start_main ../csu/libc-start.c:308
#9 0x433e29 in _start (build/DDNet+0x433e29)
src/game/teamscore.cpp:34:78: runtime error: index -1 out of bounds for type 'int const[64]'
#0 0xf5be68 in CTeamsCore::CanCollide(int, int) const src/game/teamscore.cpp:34
#1 0xf46458 in CCharacterCore::Tick(bool) src/game/gamecore.cpp:271
#2 0xaf7374 in CGameClient::DetectStrongHook() src/game/client/gameclient.cpp:2442
#3 0xadd734 in CGameClient::UpdatePrediction() src/game/client/gameclient.cpp:2249
#4 0xad6e17 in CGameClient::OnNewSnapshot() src/game/client/gameclient.cpp:1675
#5 0x522d55 in CClient::Update() src/engine/client/client.cpp:2767
#6 0x5333e4 in CClient::Run() src/engine/client/client.cpp:3237
#7 0x557fda in main src/engine/client/client.cpp:4341
#8 0x7f55e8c75cc9 in __libc_start_main ../csu/libc-start.c:308
#9 0x433e29 in _start (build/DDNet+0x433e29)
#0 0x9f70dd in CRaceDemo::OnMessage(int, void*) src/game/client/components/race_demo.cpp:134
#1 0xab81af in CGameClient::OnMessage(int, CUnpacker*, bool) src/game/client/gameclient.cpp:823
#2 0x50ff76 in CClient::ProcessServerPacket(CNetChunk*) src/engine/client/client.cpp:2100
#3 0x51bf62 in CClient::PumpNetwork() src/engine/client/client.cpp:2580
#4 0x526b56 in CClient::Update() src/engine/client/client.cpp:2856
#5 0x5333e4 in CClient::Run() src/engine/client/client.cpp:3237
#6 0x557fda in main src/engine/client/client.cpp:4341
#7 0x7f55e8c75cc9 in __libc_start_main ../csu/libc-start.c:308
#8 0x433e29 in _start (build/DDNet+0x433e29)
src/game/client/components/ghost.cpp:600:35: runtime error: index -1 out of bounds for type 'CGameClient::CClientData [64]'
#0 0x78201a in CGhost::OnMessage(int, void*) src/game/client/components/ghost.cpp:600
#1 0xab81af in CGameClient::OnMessage(int, CUnpacker*, bool) src/game/client/gameclient.cpp:823
#2 0x50ff76 in CClient::ProcessServerPacket(CNetChunk*) src/engine/client/client.cpp:2100
#3 0x51bf62 in CClient::PumpNetwork() src/engine/client/client.cpp:2580
#4 0x526b56 in CClient::Update() src/engine/client/client.cpp:2856
#5 0x5333e4 in CClient::Run() src/engine/client/client.cpp:3237
#6 0x557fda in main src/engine/client/client.cpp:4341
#7 0x7f55e8c75cc9 in __libc_start_main ../csu/libc-start.c:308
#8 0x433e29 in _start (build/DDNet+0x433e29)
Hopefully fixes these by initializing m_Pos:
src/game/collision.cpp:345:10: runtime error: -nan is outside the range of representable values of type 'int'
#0 0x55e85a8f0967 in CCollision::IntersectLineTeleHook(vector2_base<float>, vector2_base<float>, vector2_base<float>*, vector2_base<float>*, int*) /media/ddnet/src/game/collision.cpp:345:10
#1 0x55e85a90767b in CCharacterCore::Tick(bool) /media/ddnet/src/game/gamecore.cpp:255:27
#2 0x55e85af8e477 in CCharacter::Tick() /media/ddnet/src/game/client/prediction/entities/character.cpp:562:9
#3 0x55e85afc867f in CGameWorld::Tick() /media/ddnet/src/game/client/prediction/gameworld.cpp:193:10
#4 0x55e85af500b8 in CGameClient::UpdatePrediction() /media/ddnet/src/game/client/gameclient.cpp:2279:16
#5 0x55e85af48b9b in CGameClient::OnNewSnapshot() /media/ddnet/src/game/client/gameclient.cpp:1675:3
#6 0x55e85a9fdf8c in CClient::Update() /media/ddnet/src/engine/client/client.cpp:2767:22
#7 0x55e85aa0cefe in CClient::Run() /media/ddnet/src/engine/client/client.cpp:3237:4
#8 0x55e85aa2eb2e in main /media/ddnet/src/engine/client/client.cpp:4341:11
#9 0x7feedbc65151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
#10 0x55e85a77be0d in _start (/media/ddnet/DDNet+0x705e0d)
src/base/math.h:22:40: runtime error: -nan is outside the range of representable values of type 'int'
#0 0x55e85a900c2f in round_to_int(float) /media/ddnet/src/base/math.h:22:40
#1 0x55e85a90cac1 in CCharacterCore::Write(CNetObj_CharacterCore*) /media/ddnet/src/game/gamecore.cpp:515:22
#2 0x55e85a90e171 in CCharacterCore::Quantize() /media/ddnet/src/game/gamecore.cpp:574:2
#3 0x55e85af90be9 in CCharacter::TickDefered() /media/ddnet/src/game/client/prediction/entities/character.cpp:580:9
#4 0x55e85afc8a1b in CGameWorld::Tick() /media/ddnet/src/game/client/prediction/gameworld.cpp:201:10
#5 0x55e85af500b8 in CGameClient::UpdatePrediction() /media/ddnet/src/game/client/gameclient.cpp:2279:16
#6 0x55e85af48b9b in CGameClient::OnNewSnapshot() /media/ddnet/src/game/client/gameclient.cpp:1675:3
#7 0x55e85a9fdf8c in CClient::Update() /media/ddnet/src/engine/client/client.cpp:2767:22
#8 0x55e85aa0cefe in CClient::Run() /media/ddnet/src/engine/client/client.cpp:3237:4
#9 0x55e85aa2eb2e in main /media/ddnet/src/engine/client/client.cpp:4341:11
#10 0x7feedbc65151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
#11 0x55e85a77be0d in _start (/media/ddnet/DDNet+0x705e0d)
src/engine/client/serverbrowser.cpp:295:88: runtime error: index 64 out of bounds for type 'CServerInfo::CClient [64]'
#0 0x565020e035bd in CServerBrowser::Filter() /media/ddnet/src/engine/client/serverbrowser.cpp:295:128
#1 0x565020e053b3 in CServerBrowser::Sort() /media/ddnet/src/engine/client/serverbrowser.cpp:352:2
#2 0x565020e0c364 in CServerBrowser::Set(NETADDR const&, int, int, CServerInfo const*) /media/ddnet/src/engine/client/serverbrowser.cpp:620:2
#3 0x565020cf9854 in CClient::ProcessServerInfo(int, NETADDR*, void const*, int) /media/ddnet/src/engine/client/client.cpp:1524:20
#4 0x565020cf8132 in CClient::ProcessConnlessPacket(CNetChunk*) /media/ddnet/src/engine/client/client.cpp:1357:4
#5 0x565020d11656 in CClient::PumpNetwork() /media/ddnet/src/engine/client/client.cpp:2575:5
#6 0x565020d1ba21 in CClient::Update() /media/ddnet/src/engine/client/client.cpp:2856:2
#7 0x565020d26efe in CClient::Run() /media/ddnet/src/engine/client/client.cpp:3237:4
#8 0x565020d48b2e in main /media/ddnet/src/engine/client/client.cpp:4341:11
#9 0x7f4311524151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
#10 0x565020a95e0d in _start (/media/ddnet/DDNet+0x705e0d)