4992: Add sanitizer runs to bors too, ignore pnglite shift ubsan issue r=Jupeyy a=def-
`@ChillerDragon`
## Checklist
- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] 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: def <dennis@felsin9.de>
/home/runner/work/ddnet/ddnet/src/engine/external/pnglite/pnglite.c:68:16: runtime error: left shift of 170 by 24 places cannot be represented in type 'int'
#0 0x1b85f2f in file_read_ul /home/runner/work/ddnet/ddnet/src/engine/external/pnglite/pnglite.c:68:16
#1 0x1b7e129 in png_read_ihdr /home/runner/work/ddnet/ddnet/src/engine/external/pnglite/pnglite.c:171:2
#2 0x1b7d867 in png_open_read /home/runner/work/ddnet/ddnet/src/engine/external/pnglite/pnglite.c:275:11
#3 0xb59f78 in CGraphics_Threaded::LoadPNG(CImageInfo*, char const*, int) /home/runner/work/ddnet/ddnet/src/engine/client/graphics_threaded.cpp:642:14
#4 0xb54e78 in CGraphics_Threaded::LoadTexture(char const*, int, int, int) /home/runner/work/ddnet/ddnet/src/engine/client/graphics_threaded.cpp:517:5
#5 0x18e24f7 in CEditor::Init() /home/runner/work/ddnet/ddnet/src/game/editor/editor.cpp:6354:32
#6 0xa8732e in CClient::Run() /home/runner/work/ddnet/ddnet/src/engine/client/client.cpp:2917:13
#7 0xaef796 in main /home/runner/work/ddnet/ddnet/src/engine/client/client.cpp:4462:11
#8 0x7ff6950d80b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2)
#9 0x43ce7d in _start (/home/runner/work/ddnet/ddnet/san/DDNet+0x43ce7d)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/runner/work/ddnet/ddnet/src/engine/external/pnglite/pnglite.c:68:16 in
4970: Add UBSan and ASan to CI r=def- a=ChillerDragon
Start server and headless client once and see if it gets some ubsan or asan hits.
The headless client might have less or different violations of the holy c++ standard but its the best way to get some client code runtime in the CI.
Related issue https://github.com/ddnet/ddnet/issues/3050
Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
4989: Add null backend r=def- a=ChillerDragon
Thanks to `@Jupeyy` for the idea.
Replacing graphics_threaded_null.h with a null backend
makes code maintenance and memory cleanup easier.
Fixes these memory leaks in headless client (https://github.com/ddnet/ddnet/pull/4970)
```
Direct leak of 1048576 byte(s) in 1 object(s) allocated from:
#0 0x4b6f6d in malloc (/home/runner/work/ddnet/ddnet/san/DDNet+0x4b6f6d)
#1 0xd92ffb in CTextRender::InitTextures(int, int, IGraphics::CTextureHandle (&) [2], unsigned char* (&) [2]) /home/runner/work/ddnet/ddnet/src/engine/client/text.cpp:325:24
#2 0xd53795 in CTextRender::LoadFont(char const*, unsigned char const*, unsigned long) /home/runner/work/ddnet/ddnet/src/engine/client/text.cpp:729:3
#3 0xade5cd in CClient::LoadFont() /home/runner/work/ddnet/ddnet/src/engine/client/client.cpp:4070:32
#4 0x155b3de in CGameClient::OnInit() /home/runner/work/ddnet/ddnet/src/game/client/gameclient.cpp:246:12
#5 0xa8ecfe in CClient::Run() /home/runner/work/ddnet/ddnet/src/engine/client/client.cpp:2933:16
#6 0xaf6726 in main /home/runner/work/ddnet/ddnet/src/engine/client/client.cpp:4458:11
#7 0x7fadd9e610b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2)
```
## 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 if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [x] 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: ChillerDrgon <ChillerDragon@gmail.com>
4990: fix pistol sounds for BW servers r=def- a=NouaaTW
<!-- What is the motivation for the changes of this pull request -->
## 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 if it works standalone, system.c especially
- [ ] 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: Noa <75568768+NouaaTW@users.noreply.github.com>
4964: allow freecam to center on world border r=def- a=C0D3D3V
fixes#4953
I think the 200 units or 6.25 blocks more should not bother anyone.
![fix 2022-04-09_15-14](https://user-images.githubusercontent.com/14315968/162576159-7d73eb8c-b9c9-471b-bed0-7477568376d6.png)
under some circumstances, it will only move to x=1 (or in blocks 0.03) but this should be negligible.
## Checklist
- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
4984: Don't read from backend if Init failed r=def- a=Jupeyy
fixes#4981
This `bug` should not create any uninitended behavior, since these values get reinitialized after the backend creation worked
## Checklist
- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] 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)
4985: Close sockets r=def- a=ChillerDragon
https://github.com/ddnet/ddnet/pull/4970
Fixes
```
Direct leak of 205848 byte(s) in 1 object(s) allocated from:
#0 0x4a200d in malloc (/home/runner/work/ddnet/ddnet/san/DDNet-Server+0x4a200d)
#1 0xc7fe3f in net_udp_create /home/runner/work/ddnet/ddnet/src/base/system.cpp:1640:41
#2 0xbf2d0b in CNetServer::Open(NETADDR, CNetBan*, int, int) /home/runner/work/ddnet/ddnet/src/engine/shared/network_server.cpp:55:13
#3 0x568cdc in CServer::Run() /home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:2448:60
#4 0x5a922b in main /home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:3718:21
#5 0x7ff75f52c0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2)
```
## Checklist
- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [x] 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: ChillerDrgon <ChillerDragon@gmail.com>
4988: Update voting.cpp r=def- a=bencie
fix console help text for callvote parameters
<!-- What is the motivation for the changes of this pull request -->
## Checklist
- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] 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: bencie <78111412+bencie@users.noreply.github.com>
4976: fix rendering of nameplates for spectating tees r=def- a=C0D3D3V
bug was introduced by #4870
## 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 if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
4974: Its is not ctrl+leftclick but ctrl+rightclick r=def- a=ChillerDragon
Thanks to `@c0d3d3v` for debugging my left right weakness lmao.
I initially intended left click but that was conflicting with navigation already so I switched it. But not the description.
Co-authored-by: ChillerDrgon <ChillerDragon@gmail.com>
4975: fix local hookline direction when mouse is exactly centerered r=def- a=sjrc6
`@C0D3D3V` Mentioned this issue in comments of previous PR
https://github.com/ddnet/ddnet/pull/4760#issuecomment-1094307657
If you use the bind which limits your cursor range for 45 degree angles and constantly push your cursor to the left it will cause the angle to be inaccurate. <s> I believe this is because of NaNs from division by zero but I'm not totally sure. </s>. The cursor gets moved away from 0,0 whenever we send an input but it's allowed to be there in between ticks which causes this issue.
I just copied this fix from other places in the code that deal with the same issue.
https://user-images.githubusercontent.com/14315968/162629342-c8bdeea4-f06f-472f-94b3-e7cccd597eb8.mp4
## 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 if it works standalone, system.c especially
- [ ] 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: Tater <Mr.Potatooh@gmail.com>
4971: Fix undefined behavior in fixed point number conversion r=def- a=Robyt3
See #4970:
```
/home/runner/work/ddnet/ddnet/src/base/math.h:50:11: runtime error: left shift of negative value -32
#0 0x198d955 in i2fx(int) /home/runner/work/ddnet/ddnet/src/base/math.h:50:11
#1 0x197ebdf in CLayerQuads::NewQuad(int, int, int, int) /home/runner/work/ddnet/ddnet/src/game/editor/layer_quads.cpp:47:22
#2 0x18ef8d3 in CEditor::Init() /home/runner/work/ddnet/ddnet/src/game/editor/editor.cpp:6360:18
#3 0xa8e5be in CClient::Run() /home/runner/work/ddnet/ddnet/src/engine/client/client.cpp:2917:13
#4 0xaf6726 in main /home/runner/work/ddnet/ddnet/src/engine/client/client.cpp:4458:11
#5 0x7fadd9e610b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2)
#6 0x43cefd in _start (/home/runner/work/ddnet/ddnet/san/DDNet+0x43cefd)
```
Upstream https://github.com/teeworlds/teeworlds/pull/3143.
## Checklist
- [X] Tested the change ingame (on upstream)
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [X] Changed no physics that affect existing maps
- [X] 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: Robert Müller <robytemueller@gmail.com>
4972: fix calculation of m_Angle of CCharacterCore r=def- a=C0D3D3V
fixes#4969fixes#4138
The problem of #4138 can be seen in the following picture:
![image](https://user-images.githubusercontent.com/14315968/162630858-2a1a813d-0551-4739-9f8a-9ed9017fdb9b.png)
we have a strange angle circle, it was fixed in 0.7. For 0.7 to interpolate correctly between two network packets we should send the correct angle circle.
The poblem from #4969 I have already described and follows directly from the wrong calculation.
The PR fixes both problems. Here is a video, first I show how it behaves now in our client, then in a 0.7 client.
https://user-images.githubusercontent.com/14315968/162630563-83847e3f-4d29-48d9-adc1-fb3ba20cc387.mp4
## Checklist
- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
4965: Update russian.txt r=def- a=gerdoe-jr
<!-- What is the motivation for the changes of this pull request -->
## Checklist
- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] 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: Vlad <51330274+gerdoe-jr@users.noreply.github.com>
4961: Minor refactoring: Move/Merge variable declarations with assignments in CServer and CClient r=def- a=Robyt3
## Checklist
- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] 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: Robert Müller <robytemueller@gmail.com>
4960: fix#4956 r=def- a=C0D3D3V
if the snapshots are in a different order than predicted SPEC_FREEVIEW was forced although a different ID is desired in NETOBJTYPE_SPECTATORINFO.
## Checklist
- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [x] Considered possible null pointers and out of bounds array indexing
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Changed no physics that affect existing maps
- [x] 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
4958: Editor: ctrl+leftclick tile to select layer r=def- a=ChillerDragon
https://user-images.githubusercontent.com/20344300/162440855-c716f6ba-4828-4c4b-97d2-e8e3da3ab4ea.mp4
Ctrl+leftclick on a tile in the map to select the layer that has tiles placed there. Useful if there are a lot of overlapping layers. Or plenty of doodads layers for example.
## Checklist
- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] 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: ChillerDrgon <ChillerDragon@gmail.com>