Commit graph

3824 commits

Author SHA1 Message Date
c0d3d3v 320e9e030f
Rename Read() function to avoid equal naming 2022-04-14 13:38:55 +02:00
c0d3d3v 5ac46f9bd5
Many new indicators have been added to the HUD
- A display of the weapons available to the player
- The weapon the player is carrying is highlighted
- Indicators for the special abilities of the player
- Indicators for abilities taken away from the player
- Control indicators for dummy controls
- The jump indicator has been slightly adjusted
2022-04-14 13:38:55 +02:00
c0d3d3v 7abeaf0cd7
Preparations for the new HUD
- add pickup sprites to 0.6 data source
- New Enum for the 4 pickup categories
- Remove the unnecessary access to client_data7 for the pickup sprites
- Use the correct sprite set for the HUD sprites
- Read existing weapons into m_Predicted so that this information matches the last snap if the CCharacter is not predicted
- Move m_aWeapons from CCharacter to CCharacterCore for a more consistent data model since it was previously defined twice in the server and client (further so that it can be accessed with m_Predicted)
- Read CNetObj_Character into m_Predicted so that this information matches the last snap if the CCharacter is not predicted.
2022-04-14 13:38:55 +02:00
c0d3d3v b23811b197
show local available and used jumps, in spec only available jumps 2022-04-14 13:38:54 +02:00
c0d3d3v a0164df3da
Small cleanup of HUD + comment on distance calculation at sound 2022-04-14 13:38:54 +02:00
Jupeyy 53e121841e
Return the quad offset of the first added quad, when adding new quads 2022-04-14 13:38:54 +02:00
c0d3d3v 755c260401
Add HUD Sprites, LoadHudSkin() and HUD Assets Tab 2022-04-14 13:38:42 +02:00
bors[bot] f60ae47be1
Merge #4976
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>
2022-04-12 21:48:45 +00:00
c0d3d3v e65bfa6350
fix rendering of nameplates for spectating tees (bug introduced by #4870) 2022-04-12 23:30:26 +02:00
Tater 712b3f041d fix local hookline direction when mouse is exactly center 2022-04-11 06:32:02 -05:00
c0d3d3v aeaaa67581
allow freecam to center on world border
fixes #4953
2022-04-09 15:24:57 +02:00
bors[bot] b12d334063
Merge #4960
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>
2022-04-08 15:07:40 +00:00
c0d3d3v 97d2de7af8
fix #4956
if the snapshots are in a different order than predicted SPEC_FREEVIEW was forced although a different ID is desired in NETOBJTYPE_SPECTATORINFO.
2022-04-08 16:38:37 +02:00
Dennis Felsing 8ef1f35f89 Revert "CGameClient::LoadMapSettings: Load the default tuning params by default"
This reverts commit 754562ce0b.

This breaks rendering for ddnet mode, thanks to cheeser0613 for report
2022-04-08 15:05:53 +02:00
Edgar 3c904ffbb4
fix conflict 2022-04-07 09:46:02 +02:00
Edgar 0b8152f6e3
add 1 second delay to tooltips 2022-04-07 09:43:49 +02:00
Edgar 527835e171
fix style 2022-04-07 09:43:49 +02:00
Edgar 17d93f63e3
implement DoTooltip 2022-04-07 09:43:47 +02:00
Dennis Felsing 6caa29df7c Only try joining tutorial once we have server list
Otherwise quickly pressing enter you end up not joining tutorial
2022-04-04 10:17:39 +02:00
Chairn 21e64cbdcb Added external linkage instead of static const 2022-04-03 01:12:27 +02:00
bors[bot] 2be8dc69cb
Merge #4941
4941: Keep DDNet window responsive for loading tasks r=def- a=Jupeyy

This will keep the DDNet window responsive, especially when loading the client the first time this is important, so that SDL2 events aren't lost.

Menu's RenderLoading allows up to 60 frames per second, so calling it too often cannot really happen.

For reloading (skins&assets) / demo loading etc. it only swaps to the render screen after half a second passed. Even if this might not be the nicest, it's still better than just freezing the window.

I hope this addresses issues from #4936



## 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: Jupeyy <jupjopjap@gmail.com>
2022-04-02 15:19:26 +00:00
Jupeyy f7e3662cd7 Keep DDNet window responsive for loading tasks 2022-04-02 17:03:23 +02:00
c0d3d3v 549fd7c784
fix color of ghost 2022-04-01 23:48:25 +02:00
Dennis Felsing 27488f042f Fix IME issue (fixes #4888)
by terminating string instead of assuming that rest of chars are \0,
which was just luckily true before.
2022-03-31 12:52:24 +02:00
Dennis Felsing 2c1dfb3684 m_DisplayStr -> m_aDisplayStr 2022-03-31 12:52:24 +02:00
bors[bot] f953a9850e
Merge #4930
4930: Adjustable hook collision line alpha r=def- a=sjrc6

Suggested by louis in https://github.com/ddnet/ddnet/issues/4928


![image](https://user-images.githubusercontent.com/22122579/160996132-68fe36c1-7e64-4b7e-b1d7-f41c11d69e51.png)
![image](https://user-images.githubusercontent.com/22122579/160996410-3447bc23-73e3-4f99-a22e-cfa8486582d1.png)


- [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
- [ ] 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>
2022-03-31 07:45:20 +00:00
bors[bot] 11af040689
Merge #4927
4927: Revert "Revert "Update players.cpp"" (fixes #4926) r=Jupeyy a=def-

This reverts commit 36bfe24522.

Tested and couldn't reproduce the original problem with this.

<!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-03-31 07:08:36 +00:00
Tater 3a197aa3da Hook collision line alpha 2022-03-30 20:15:27 -05:00
bors[bot] ebb092211a
Merge #4924
4924: fix gohst transparency of hook hand and ninja skin r=def- a=C0D3D3V

 https://streamable.com/oquu51
 
 reported by lomination 
fixes #4207 again

## 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-03-30 21:35:20 +00:00
Dennis Felsing 68c7044912 Revert "Revert "Update players.cpp"" (fixes #4926)
This reverts commit 36bfe24522.
2022-03-30 23:29:35 +02:00
c0d3d3v 005667b99c
fix gohst transparency of hook hand and ninja skin 2022-03-30 20:40:46 +02:00
bors[bot] c592e71353
Merge #4917
4917: Use std::size instead of sizeof(a) / sizeof(a[0]) r=Jupeyy a=def-

<!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-03-30 17:08:27 +00:00
Dennis Felsing 843acf6a5a Use std::size instead of sizeof(a) / sizeof(a[0]) 2022-03-30 18:55:04 +02:00
Dennis Felsing 36bfe24522 Revert "Update players.cpp"
This reverts commit ccc23161f6.

Caused inaccuracies. I tried checking what calculations the server does,
but couldn't figure it out quickly.
2022-03-30 17:41:59 +02:00
srdante ddba1dfdc2 Fix styles 2022-03-29 17:39:16 -03:00
srdante b642f519c1 Fix whisper sending/receiving differentiation 2022-03-29 17:35:50 -03:00
bors[bot] ea852d8f1c
Merge #4852
4852: Fixed some useless double promotion r=def- a=Chairn

Double promotion occurs quite often when an operator is an hidden double, like constants written without the 'f' at the end. We might get a tiny micro improvement. Unfortunately, we can't do anything for all the double promotion occurring in printf like functions as it is the default for both C and C++.

Only this line might change physics:
4d47fcda09 (diff-d76009083687ba43c59dc7bb2c7357457c999c2eb9d913967d598e913c6fd01fR406)

## 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
- [x] 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: Chairn <chairn.nq@hotmail.fr>
2022-03-25 18:29:02 +00:00
Dennis Felsing 939d5436b0 Retry tutorial join after 5 seconds 2022-03-25 17:37:55 +01:00
Dennis Felsing ebd76d9db5 Add tutorial button in main menu
As suggested by cheeser0613
2022-03-25 17:14:47 +01:00
bors[bot] e8fc1758a7
Merge #4885 #4889
4885: Add dropdown icon r="def-" a=Jupeyy

![image](https://user-images.githubusercontent.com/6654924/159912581-f382179d-9d66-41f8-8a41-647e4e34edf5.png)

## 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
- [ ] 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)


4889: Fix text texture name Texture -> TextureOutline r="def-" a=Jupeyy



## 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: Jupeyy <jupjopjap@gmail.com>
2022-03-24 21:26:33 +00:00
Chairn 3778e0ff6b Format member variable's name correctly 2022-03-24 19:30:26 +01:00
Chairn 6086893fa6 Renamed all shadowing/shadowed variables 2022-03-24 17:59:49 +01:00
bors[bot] 309283d551
Merge #4870
4870: Don't render tees or nameplates offscreen r=def- a=sjrc6

It seems difficult to measure the fps from the ingame graph or fps counter so these numbers are from NVidia fps overlay

FPS on full multeasymap server, fullscreen, vulkan renderer
/showall 0 - 4500
/showall 1 - 2100
/showall 1 (after preventing offscreen render) - 4200

## 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: Tater <Mr.Potatooh@gmail.com>
2022-03-24 14:44:26 +00:00
Tater 5c29456dd8 Improve nameplate boundary and clarify comments 2022-03-24 15:43:58 +01:00
Jupeyy 5459895dc0 Add dropdown icon 2022-03-24 13:05:21 +01:00
Chairn e0c6106930 Revert time to double type 2022-03-23 19:34:51 +01:00
Chairn d4aac67929 Fixed some useless double promotion 2022-03-23 18:22:08 +01:00
Tater abaf216f5c Seperate hook collision line from player rendering 2022-03-22 19:19:44 -05:00
Jupeyy afb205cf6f Check pTexName for nullptr, fix wrongly height->width 2022-03-22 20:28:33 +01:00
Tater 54e8b64136 Don't render tees or nameplates offscreen 2022-03-22 11:20:21 -05:00
Jupeyy fbeba9eb5f Add Vulkan backend 2022-03-21 12:39:51 +01:00
Jupeyy 14ac5cf297 lazy load editor textures
improve entities texture flags
2022-03-20 18:03:33 +01:00
Jupeyy e54da1b396 Cleanup backend a bit for vulkan 2022-03-20 18:03:25 +01:00
bors[bot] 564a59d603
Merge #4845
4845: Enable -Wshadow=local r=Jupeyy a=def-

> Warn when a local variable shadows another local variable or parameter.

Found one actual bug in graphics_threaded.cpp

Should reduce confusion in the future when reading source code

<!-- 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: def <dennis@felsin9.de>
2022-03-20 16:45:22 +00:00
def 8134f9fa55 Enable -Wshadow=local
> Warn when a local variable shadows another local variable or parameter.

Found one actual bug in graphics_threaded.cpp

Should reduce confusion in the future when reading source code
2022-03-20 13:24:34 +01:00
bors[bot] 12b7ff3d4c
Merge #4842
4842: Replace browser icons with font icons r=def- a=Jupeyy

Replace and remove the menu icons and use the font icons instead.
Personally i find them more attractive, and objectivly they are resolution indepentent.

Opinions?

before:
![screenshot_2022-03-19_11-26-51](https://user-images.githubusercontent.com/6654924/159117535-6e027259-b7bc-43ff-b87b-80aabc368e97.png)

![screenshot_2022-03-19_11-31-02](https://user-images.githubusercontent.com/6654924/159117539-a0617fe6-4d30-407e-9b5c-588bd27c6834.png)

after:
![screenshot_2022-03-19_11-45-24](https://user-images.githubusercontent.com/6654924/159117919-d0deb3c7-2631-4233-a7e0-2b1e83362248.png)

![screenshot_2022-03-19_11-30-41](https://user-images.githubusercontent.com/6654924/159117546-db8f68d7-253c-4b99-9a8d-9f6668d0cb11.png)

![screenshot_2022-03-19_11-44-16](https://user-images.githubusercontent.com/6654924/159117880-0523ee15-e5f0-495c-9f5b-fe3e897efe79.png)


## 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
- [ ] 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>
2022-03-20 10:51:14 +00:00
bors[bot] f49afca3dc
Merge #4818
4818: Add str_startswith_nocase and str_endswith_nocase r=def- a=ChillerDragon

Gets rid of the more complex str_comp_nocase_num usage

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [x] 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
- [ ] 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: ChillerDragon <ChillerDragon@gmail.com>
2022-03-20 10:27:18 +00:00
def 3d47274f28 Add tutorial joining code and tutorial map 2022-03-19 23:35:27 +01:00
Jupeyy daea2feca9 Switch to Font-Awesome 2022-03-19 19:14:30 +01:00
Jupeyy 343a5291e5 Replace browse icons with icon font 2022-03-19 18:35:43 +01:00
srdante 216accbe73 Fix style warning 2022-03-18 20:37:20 -03:00
srdante 9dc944ab03 Fix player death effect color 2022-03-18 20:31:49 -03:00
Dennis Felsing 71432bd19d Fix demo render menu 2022-03-18 16:28:47 +01:00
bors[bot] c712b756ab
Merge #4826
4826:  Improvement of the automatic completion of player names in chat r=def- a=C0D3D3V

This should fix #659 or just improve the order of player names if you use automatic completion. 

So far it was so that first at the beginning of the name was searched for the input and then there was a second iteration through the alphabetically sorted list with names where the input does not appear at the beginning.

Now it is so that the position of the input in the name is used as an evaluation criterion to determine the position in the suggestion list. If the input is found at the beginning of the name, the score is 0 and the name is suggested first. If the input is found at position 6 in the name, the score is 6 and the name appears later in the suggestion list. If two names have the same score, the alphabetical sorting remains.


## 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>
2022-03-16 15:32:49 +00:00
c0d3d3v 92eaccfcb2
Improvement of the automatic completion of player names in chat 2022-03-16 15:25:56 +01:00
bors[bot] d172a7fd2a
Merge #4802
4802: make the vanilla teams independent from the ddrace teams r=def- a=C0D3D3V

Fixes #259
Because my changes have some effects on the display and thus people who like it as it was could bother, I have described my changes in detail here.

Until now it was the case that players who are in /spec (while sv_pausable is activated) or the own active player who is in /pause or /spec are in the Spectators team.

With this change this is no longer the case. I took the opportunity to make a few adjustments in the display logic. 

On the server side nothing had to be adjusted, because there was already a separation of the normal and the ddnet teams. 


1. Regarding the specators component:

I intentionally did not adjust the conditions in the OnRender function (lines 224, 306, 325 and 338) so that you can manually select players who are in /spec to watch as well.
I find this helpful, because it has often annoyed me not to be able to quickly find players who are in /spec on the map.

This also allows the selection of players that are in spec in demos. The only problem is that in demos the information about sepc players is missing (The same as in Game, only in Game the information is provided as soon as you spectate). However, until now this was also the case for players who are not in their own team. I find it handy to also have Spec players selectable, so that when they become active, the camera follows them directly.

In addition, you can spectate yourself in demos as well as in the game.
In demos this was already possible, as long as the own player in the demo is not currently in pause, at that moment you could only follow the recorded spectating camera. 

However, I have kept that in SpectateNext, SpectatePrevious and SpectateClosest the own player is not included. However, it is also possible to jump here in spectating to players in /spec.  


2.  Regarding the scoreboard component:

Now only real spectators are displayed under the scoreboard in the spectators team. No longer players who are in /spec or the own player who is currently paused.
So I did not adjust line 125, 341, 354, 367.

Line 724 would not need to be adjusted anyway since it only affects vanilla team games. If the function GetClanName is used for DDnet, this has the effect that paused players are also included.

I have adjusted the active condition of the scoreboard so that it is not automatically displayed when the player is spectating (that's the way it used to be).

Since now the own player is shown in the scoreboard even if he is paused, I have removed the marking of the own player when following another player (line 416).


3.  Regarding the menus_ingame component:
I left the behavior as it was, since we are talking about dangerous commands here (join spectator team and commit suicide) I think it is quite good that these are hidden when the player is paused.

To maintain this behavior, when creating the kill button, we must also check if we are not in pause or spec.
Actually we could check here m_pClient->m_Snap.m_SpecInfo.m_Active just like I did in the scoreboard, but since the code was already created I kept it.


4.  Regarding the IsOtherTeam function in gameclient:
This function is used to determine if the transparency m_ClShowOthersAlpha should be applied to players and nameplates of other teams and if entities of other teams should be predicted.

So I left the behavior as it was, i.e. if you pause via /pause or /spec the transparency is not applied, because then False is returned.

5. Regarding the HUD component:
I have not adjusted any condition here (line 310, 319 and 323). So far the behavior was that when the player went on pause (/pause /spec), in the small time display at the bottom right the top2 players were displayed and otherwise the best and the own player.
Now it is so that the own player is also displayed when he is paused, but not when he is a real spectator.
I personally find it strange why the display should change just because you pause. 

6. Regarding the chat component:

If the dummy paused is in the same team as the player and then a team message arrives, it will no longer be double logged.
Until now, when a player is in the same team in /spec and sends a message, his name was displayed in the Spectators team color and not in the team color. Since I have not adjusted the condition in line 803, the player names are also displayed in the team color for such messages.


7. Regarding the items component:

Here it is determined whether the local player is in the game and depending on that other GameTicks are used and ReconstructSmokeTrail is not canceled. 
Here I could not work in so exactly, no idea what consequences this has that I have not adjusted the conditions in line 47 and 560.  
I noticed at least when testing no difference, maybe someone who knows about it can explain to me what that has for effects.


About all changes I made we can discuss I am ready to undo them or restore the behavior as it was before.  But please justify with arguments.


Independently:
I added a -1 check for the m_LocalClientID to the Strong Week indicators in the Nameplates. So that with server demos the array is not accessed outside of the array range. For demos there are currently no predicted characters and therefore no strong week indicators, so it doesn't change anything.


## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change  
I can provide screenshots to compare before after, but it's best to test it yourself.

- [ ] 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
- [ ] 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>
2022-03-14 13:06:42 +00:00
c0d3d3v 4619e825f3
make spectators team independent 2022-03-14 13:25:47 +01:00
bors[bot] 8ea73b7800
Merge #4822
4822: Auto select search string on hot key r=def- a=Jupeyy

Pressing CTRL+F should select the current search string, like basically every text editor and browser does

## 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: Jupeyy <jupjopjap@gmail.com>
2022-03-13 18:23:02 +00:00
Jupeyy cce42d41de Auto select search string on hot key 2022-03-13 19:12:06 +01:00
ChillerDragon 99b0eb2819 Add str_startswith_nocase and str_endswith_nocase 2022-03-13 11:42:45 +01:00
bors[bot] a1668e0a5b
Merge #4812
4812: Full size sound settings r=Jupeyy a=def-

Old:
![screenshot-20220312@234506](https://user-images.githubusercontent.com/2335377/158037595-d3a6affc-3092-4b6c-9668-aab13f66801c.png)
New:
![screenshot-20220312@234420](https://user-images.githubusercontent.com/2335377/158037596-06889367-93d9-4c92-891b-c380653d8a3d.png)

## 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
- [ ] 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>
2022-03-13 07:23:57 +00:00
def 6b497afba4 Don't allow infinite shotgun bounce (fixes #4809) 2022-03-13 00:02:42 +01:00
def 9518e4413e Full size sound settings 2022-03-12 23:45:21 +01:00
bors[bot] d140e05a2c
Merge #4811
4811: fix bug that sneaked in during refactoring (in #4775) r=def- a=C0D3D3V

Was detected by missing hammer animation at very high ping by texnonik and bencie


## 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
- [ ] 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>
2022-03-12 19:01:34 +00:00
c0d3d3v 50eb249686
fix bug that sneaked in during refactoring (in #4775)
- was detected by missing hammer animation at very high ping
2022-03-12 18:48:04 +01:00
bors[bot] f89142b433
Merge #4790
4790: Don't print binds into F1 by default (fixes #4789) r=heinrich5991 a=def-

<!-- 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: def <dennis@felsin9.de>
2022-03-12 11:31:48 +00:00
Tater 3b93e656a0 Make hook collision line size adjustable 2022-03-11 21:19:17 -06:00
Jupeyy 95fe457abb Auto font size 2022-03-11 17:34:48 +01:00
Robert Müller 74f87ee604 Remove unnecessary trailing semicolons after method declarations 2022-03-08 20:01:26 +01:00
bors[bot] 849513f9ed
Merge #4787
4787: Fix some spacing in settings with German r=heinrich5991 a=def-

Reported by Izanagi on Discord
Old:
![screenshot-20220305@100323](https://user-images.githubusercontent.com/2335377/156877157-53e59c1c-455c-4ee1-ae44-14099c58d68d.png)
New:
![screenshot-20220305@102430](https://user-images.githubusercontent.com/2335377/156877213-92be8b48-9844-4095-adc7-6d70f203e63e.png)

## 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
- [ ] 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>
2022-03-08 16:07:00 +00:00
Alexander Akulich d4dbceea6c CPlayers::RenderPlayer: Stop overriding the Tee size
Tee size is already set to this value (64px) 372 lines above.

(Setting this value again makes it harder to customize this value)
2022-03-08 14:24:37 +03:00
Alexander Akulich 754562ce0b CGameClient::LoadMapSettings: Load the default tuning params by default
The code which changes the default settings ruins demo playback for
default modes.
2022-03-08 14:24:37 +03:00
Alexander Akulich 0a30d8a058 Apply snd_gun and snd_long_pain options only to DDRace and FNG games
On 'traumatic' game types (e.g. vanilla dm, tdm, ctf) it is critical to
hear SOUND_GUN_FIRE (because someone seems to shooting at you).

It is not any less important to head SOUND_PLAYER_PAIN_LONG which takes
its place whenever the character taken damage > 2 (because you need to
know whether someone was hit).
2022-03-08 14:24:37 +03:00
Alexander Akulich e140d4c82e CBinds: Change 'no modifiers' value from '1' to '0'
The default bindings are set up via calls like Bind(KEY_A, "+left"); which
expands to Bind(KEY_A, "+left", /* FreeOnly */ false, /* ModifierCombination */ 0);

On the other hand, CMenusKeyBinder code does this: if(!Mask) Mask = 1 << MODIFIER_NONE;

This leads to a bug — binds which just set from the user input events are saved
in e.g. m_aapKeyBindings[1]['a'], and the default binds are still there
in m_aapKeyBindings[0]['a'] which leads to binds duplication in the UI.
2022-03-08 14:13:46 +03:00
c0d3d3v e01b1c5b3d
use TEAM_SPECTATORS and SPEC_FREEVIEW instead of -1 2022-03-07 22:16:28 +01:00
bors[bot] 2c4c858c24
Merge #4775
4775: Refactoring of players OnRender function r=def- a=C0D3D3V

Does anyone else feel that the code here: ff085a4545/src/game/client/components/players.cpp (L660-L709) is somewhat obfuscated? I do not think that the compactness of the code at this point increases the readability :D


## 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
- [ ] 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>
2022-03-07 10:36:48 +00:00
def 6c0a564733 Don't print binds into F1 by default (fixes #4789) 2022-03-06 12:22:29 +01:00
def 729303822c Fix some spacing in settings with German 2022-03-05 10:24:26 +01:00
c0d3d3v e36363c2e2
deobfuscate players OnRender function 2022-03-04 20:03:24 +01:00
bors[bot] 237a9170bd
Merge #4778 #4780
4778: More space for players in server browser (fixes #4777) r=Jupeyy a=def-

Old:
<img width="920" alt="Screenshot 2022-03-03 at 20 23 38" src="https://user-images.githubusercontent.com/2335377/156637630-a68291e3-7859-46b0-9a7c-249629d5a875.png">
New:
<img width="898" alt="Screenshot 2022-03-03 at 20 21 28" src="https://user-images.githubusercontent.com/2335377/156637402-6a8669bd-331d-402f-888c-97e2f3f189a6.png">

## 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
- [ ] 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)


4780: Update Korean translation by CHaBek r=edg-l a=def-

<!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-03-04 09:09:21 +00:00
c0d3d3v 8ddd53ab62
add enum for ShowOthers value 2022-03-03 22:56:32 +01:00
Dennis Felsing c7e1cf7d7a More space for players in server browser (fixes #4777) 2022-03-03 20:22:02 +01:00
bors[bot] e215aeb232
Merge #4768
4768: Videorecorder on by default (also for github builds) r=Jupeyy a=def-

<!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-03-02 08:02:32 +00:00
bors[bot] ac05c14c78
Merge #4771
4771: fix Alpha of Muzzle r=def- a=C0D3D3V

In principle https://github.com/ddnet/ddnet/issues/4207 has already been fixed with https://github.com/ddnet/ddnet/pull/4770
But I don't know if the bug has influence on another part. The faulty animation code is hereby fixed. The problem is that when you shoot with the Rifle or the Shotgun the Muzzle animation is executed. This manipulates Alpha, Alpha itself is actually redefined in the condition, but apparently it overwrites the Alpha used for RenderHand since it is in the same code block (from line 279 to 537).  


Co-authored-by: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-03-01 22:55:49 +00:00
c0d3d3v e376eb995d
fix Alpha of Muzzle 2022-03-01 23:47:47 +01:00
bors[bot] 3a28f5fc6e
Merge #4769
4769: Fix integer overflow in CHud when server time exceeds around 248 days r=def- a=Robyt3

Fixes the server timer in the HUD showing 00:00 when the server time exceeds around 248 days.

Tested on "Vanilla Teeworlds Server - CTF":

![303d](https://user-images.githubusercontent.com/23437060/156249076-d3f20853-cd0a-4545-a459-493f123eb5bc.png)

Otherwise connecting to this server causes:

```
/src/game/client/components/hud.cpp:128:17: runtime error: signed integer overflow: 26254443 * 100 cannot be represented in type 'int'
    #0 0x55c8b6722e7d in CHud::RenderGameTimer() /src/game/client/components/hud.cpp:128
    #1 0x55c8b675cdfc in CHud::OnRender() /src/game/client/components/hud.cpp:855
    #2 0x55c8b6babec7 in CGameClient::OnRender() /src/game/client/gameclient.cpp:598
    #3 0x55c8b62b0330 in CClient::Render() /src/engine/client/client.cpp:1179
    #4 0x55c8b6301a62 in CClient::Run() /src/engine/client/client.cpp:3155
    #5 0x55c8b635fc34 in main /src/engine/client/client.cpp:4427
    #6 0x7f581a6150b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
    #7 0x55c8b60f478d in _start (/build-asan/DDNet+0x1bd978d)
```

## 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
- [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>
2022-03-01 22:38:43 +00:00
Robert Müller f89e6b6599 Fix integer overflow in CHud when server time exceeds around 248 days 2022-03-01 23:22:06 +01:00
Dennis Felsing 687f3e6160 Remove some useless conditions around free 2022-03-01 23:19:49 +01:00
bors[bot] 3f36041c9c
Merge #4770
4770: Allow the ghost to carry any weapon r=def- a=C0D3D3V

I tried to reproduce another bug (https://github.com/ddnet/ddnet/issues/4207) and I noticed that ghosts are not allowed to carry any other weapons except grenade launcher and pistol. This is no longer necessary since we have been using the general renderer for players for a long time. We don't create projectiles for Ghosts, but it's always been like that and doesn't look worse than before.
![image](https://user-images.githubusercontent.com/14315968/156250428-3d8105d6-cf4a-4dd1-bf5c-cf1b9cab81d3.png)
![image](https://user-images.githubusercontent.com/14315968/156250490-02ac6d31-9146-47ff-89ac-9f4153d327a8.png)

So now you can see at least when the tee was frozen (before he was as seen in the linked issue with pistol in the freeze and alive)
![image](https://user-images.githubusercontent.com/14315968/156250525-857ca975-922f-48db-b38b-08ca86f5bd29.png)


## 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
- [ ] 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>
2022-03-01 21:57:58 +00:00
Dennis Felsing c92423362e Videorecorder on by default (also for github builds) 2022-03-01 22:56:24 +01:00
c0d3d3v 5a621522b0
Allow the ghost to carry any weapon 2022-03-01 22:14:02 +01:00
Dennis Felsing 3cd7058fe6 Show correct server address when connecting 2022-02-28 19:38:59 +01:00
Tater ccc23161f6 Update players.cpp
Local Hook Collision line updates every frame instead of every tick
2022-02-25 06:22:51 -06:00
Chairn c0d398df38 CheckImageFormatRGBA --> IsImageFormatRGBA 2022-02-23 00:39:31 +01:00
Chairn 0ea66bca57 Clang format 2022-02-22 20:21:43 +01:00
Chairn 76064bd1c8 Drop non RGBA images 2022-02-22 20:21:34 +01:00
Robert Müller 9ebb85f520 Fix listbox item double click behavior 2022-02-20 19:58:24 +01:00
def cf23a73891 Fix style 2022-02-20 10:41:06 +01:00
simpygirl 4e7b82a3fd Fix broken checkbox 2022-02-20 04:04:47 +01:00
bors[bot] e79c166259
Merge #4697
4697: Show key presses in nameplates r=def- a=C0D3D3V


As described in [x](https://github.com/ddnet/ddnet/issues/4589) the arrows that show the key presses of the players are not visible in many situations, this is now my attempt to fix this by including the arrows in the nametags.

~~Also, I created a new option called `cl_show_direction_below` to show the arrows below the player. We can discuss whether this is useful, or whether it should simply be displayed as before only above the player.~~

## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
https://streamable.com/czk2ht
See also https://github.com/ddnet/ddnet/issues/4589
- [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
- [x] 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-02-19 12:36:50 +00:00
c0d3d3v d43ed14897
render key presses independent of m_ClNameplates 2022-02-19 13:31:34 +01:00
c0d3d3v 94c1d7fe66
remove m_ClShowDirectionBelow
Show keystrokes always above the players
2022-02-15 11:59:07 +01:00
Dennis Felsing 18d9997348 Fix clang-format 2022-02-15 00:32:04 +01:00
Dennis Felsing dbfc62d2c0 Add modernize-deprecated-headers 2022-02-15 00:22:52 +01:00
Dennis Felsing b58470fda4 Add modernize-use-equals-default 2022-02-15 00:17:57 +01:00
Dennis Felsing 2da5d7d289 Add modernize-use-emplace 2022-02-15 00:15:06 +01:00
Dennis Felsing 68e4eb21d5 Add modernize-use-bool-literals 2022-02-15 00:12:52 +01:00
Dennis Felsing 1afd1a32d1 Fix Linux build with C++20
src/game/client/components/chat.cpp: In lambda function:
src/game/client/components/chat.cpp:686:33: error: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 [-Werror=deprecated]
  686 |  auto &&FChatMsgCheckAndPrint = [=](CLine *pLine) {
      |                                 ^
src/game/client/components/chat.cpp:686:33: note: add explicit ‘this’ or ‘*this’ capture
2022-02-14 19:19:20 +01:00
Dennis Felsing 4c8e33ee8e Fix MSVC build
src\game\gamecore.cpp(185,36): warning C5055: operator '*': deprecated between enumerations and floating-point types [D:\a\ddnet\ddnet\debug\game-shared.vcxproj]
2022-02-14 19:19:20 +01:00
c0d3d3v 724a49dc59
Show keystrokes in the nametag and new option cl_show_direction_below to show the keypresses below the players 2022-02-11 14:05:37 +01:00
Robert Müller 6d15f360c1 Delay double click handling one frame after item activation 2022-02-10 17:40:03 +01:00
bors[bot] 0c5d5e1a7a
Merge #4683
4683: Init m_pNextTraverseEntity r=heinrich5991 a=Jupeyy

<!-- 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: Jupeyy <jupjopjap@gmail.com>
2022-02-09 14:36:20 +00:00
Jupeyy ea2102efcb Init m_pNextTraverseEntity 2022-02-09 15:26:50 +01:00
Dennis Felsing e428f6ab5d Ignore F5 key press when ingame menu is open
Since ghost menu and browser use F5 already to refresh, and having a
bind on it, would cause both actions at once.

I believe it makes sense to have this special handling only for F5,
other F-keys don't have this problem since we don't use them in any
menus.
2022-02-08 00:38:05 +01:00
heinrich5991 7aafc78622 Fix evolve limit
Mixed up previous and current. This did not show up in testing, because
these two were always true at the same time. I've now debugged it and
manually made specific conditions false to verify that it's working.

Sorry for the mess.
2022-02-07 14:29:49 +01:00
heinrich5991 a203478809 Make the evolve limit more visible
This is to make sure that modders don't start to rely on the fact that
we clamp the evolve duration to 3 seconds.
2022-02-07 12:16:39 +01:00
bors[bot] 4d2505284b
Merge #4624
4624: Limit evolving to 3 seconds r=heinrich5991 a=ChillerDragon

Took from upstream
5d44714e92 (diff-597779b4eb51af9adfedd04b8a235afff01091a4ba741daa604cb5cbeda4e3daR1306-R1321)

Fixes client freezes if the server sends funny ticks

## 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: ChillerDragon <ChillerDragon@gmail.com>
2022-02-07 10:50:02 +00:00
bors[bot] 3025bb0036
Merge #4668
4668: Fix bindings with modifiers r=def- a=Kaffeine

I work on a client for InfClass mod and it is important to have bindings for many situations, so we have to use modifiers (one modifier per bind).

It turned out that bindings (with a modifier) are broken in DDNet since commit 4326d00df9 which changes the implementation to support modifier combinations but it messes up the UI part.

I've considered options to revert the commit or to fix the combined modifiers and bravely 😅  choose the latter way. The code had at least five bugs and fixing e.g. four of them does not help much, making it really hard to say if the fix is correct or not. I had to rename some vars first to make the code readable and now (with the correct names) each fix should seem reasonable.

`Modifier` was confused with `ModifierCombination` in so many places. I do not like the idea of deviating from the `teeworlds` codebase but we already did it here by introducing of combined modifiers. We do not use a stronger type system (enum classes and flag classes) but one thing we can do to give a developer the idea of what is going on is to use the correct variable and argument names at least.

## 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
- [ ] 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)

I checked the follow cases:
- Binding of a normal key (e.g. `t`)
- Binding of a sole modifier (e.g. `lctrl`)
- Binding of a key combined with a modifier (e.g. `ctrl+t`)
- Binding of a key combined with many modifier (e.g. `ctrl+alt+t`)

### Before
Bindings with `Shift` modifiers displayed as `Ctrl+`, bindings with `Ctrl` or `Alt` are not displayed at all.
![image](https://user-images.githubusercontent.com/374839/152705632-42668ec2-a424-4dfa-99ff-250e146da5ea.png)

### After
All bindings displayed correctly
![image](https://user-images.githubusercontent.com/374839/152706393-08c36e36-1200-482a-9eb3-dc0d96185cdd.png)

but also it is possible to set any crazy binding from UI
![image](https://user-images.githubusercontent.com/374839/152706406-b1e18139-16a3-451e-9ac9-702b0aac4d2e.png)



Co-authored-by: Alexander Akulich <akulichalexander@gmail.com>
2022-02-07 09:24:02 +00:00
Alexander Akulich 9a5b7339cf Client: Fix projectiles rendering for demo playback
The playback timing leads to always negative client time for projectiles
fired on the current game tick.
2022-02-07 02:41:21 +03:00
Alexander Akulich 17222d67bf Binds: Reorder modifiers according to the convention
The modifiers order in the UI and console follows the order
of modifier enum items.

The conventional order of the modifiers is: Ctrl, Alt, Shift, GUI (Win, Meta).

Place Shift after Alt to get proper order, e.g.:
Alt+Shift+R (conventional) instead of Shift+Alt+R (weird)
2022-02-07 01:54:12 +03:00
Alexander Akulich 7d1595f06f Client/CMenus: Actually process and show all bindings with modifiers 2022-02-07 01:54:12 +03:00
Alexander Akulich e0876960fc CBinds: Remove unused ModifierMatchesKey() 2022-02-07 01:54:12 +03:00
Alexander Akulich fff597cd2a CMenusKeyBinder: Fix binding in cases with only a modifier key pressed 2022-02-07 01:54:12 +03:00
Alexander Akulich 2233ca98c1 CBinds::GetModifierMask: Make the method actually returning the mask
... instead of the modifier enum value.

This fixes CMenusKeyBinder which now saves the bindings into the right slot.
2022-02-07 01:54:12 +03:00
Alexander Akulich ae482d018f CMenus::DoKeyReader: Fix the UI text for binds with a modifier(s) 2022-02-07 01:50:14 +03:00
Alexander Akulich db1d136006 client/menus: Fix variable names 2022-02-07 01:50:14 +03:00
Alexander Akulich 343b2543cc Client/CBinds: Rename arguments which refers to the ModifierCombination
The first dimention of m_aapKeyBindings is ModifierCombination
since commit 4326d00df9.

Rename the arguments to make it clear when the arg is a combination
(e.g. the arg value '2' refers to '1 << MODIFIER_SHIFT' instead of 'MODIFIER_CTRL')

This is needed to make the code cleaner and the bugs more obvious.
2022-02-07 01:50:14 +03:00
Alexander Akulich 68b1afce0e client/menus_settings: Replace hardcoded config name with a macro 2022-02-06 22:44:21 +03:00
Alexander Akulich ac61a38afe CPlayers::RenderPlayer: Consistently use Alpha variable
We already use Alpha to render the weapon, Tee hand, and emoticon.
We also rendered ghost Tee with the same Alpha value.
2022-02-06 22:29:27 +03:00
bors[bot] f654b1a12c
Merge #4665
4665: Support saving any size binds (fixes #4660) r=heinrich5991 a=def-

Since we store the bind with malloc, we also need to use malloc here to
allow any size when saving the binds in config file

<!-- 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: def <dennis@felsin9.de>
2022-02-06 11:43:30 +00:00
def db4d9f9a47 Support saving any size binds (fixes #4660)
Since we store the bind with malloc, we also need to use malloc here to
allow any size when saving the binds in config file
2022-02-06 12:01:46 +01:00
bors[bot] 90944e0cac
Merge #4654
4654: Add a groundjump-only tile r=def- a=heinrich5991

Implements a new mode of jumping: "you only have ground jump".  This differs from "you only have one jump" in that it doesn't allow you to air-jump, even if you haven't jumped to get off the ground. To access this mode, it reuses the "air-jump tile" in the switch layer with the number of jumps set to 255.

This tile is planned to be used in tutorial developed by unique2 and Alisa.

## 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: heinrich5991 <heinrich5991@gmail.com>
2022-02-06 09:23:14 +00:00
heinrich5991 620d611521 Add "groundjump-only" tile
Works by setting the airjump tiles' jumps to 255.
2022-02-05 23:53:32 +01:00
heinrich5991 87df5b8c14 newJumpsNewJumps 2022-02-05 22:32:55 +01:00
Jupeyy 338b6b2238 Add windowed fullscreen ( a special case for Windows ) 2022-02-04 11:14:10 +01:00
bors[bot] f15b3afd95
Merge #4648
4648: Add some checksum functions to the client r=def- a=heinrich5991

Let's see if it works out, if not, we can revert it.

## 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: heinrich5991 <heinrich5991@gmail.com>
2022-01-31 22:42:24 +00:00
heinrich5991 1820a0e168 Add some checksum functions to the client
Let's see if it works out, if not, we can revert it.
2022-01-31 21:31:26 +01:00
def 3078d9dcfc Transfer super state to client and predict properly 2022-01-31 13:22:44 +01:00
heinrich5991 9ef3c8c94a Mark all component functions overrides with override 2022-01-31 00:53:12 +01:00
Robert Müller 4f653cfcda Use H/VSplitMid where possible 2022-01-26 20:41:08 +01:00
Robert Müller f341e96689 Use Spacing parameter where possible 2022-01-26 20:41:08 +01:00
Robert Müller 4fbca828f4 Add optional Spacing parameter to H/VSplitMid 2022-01-26 20:41:05 +01:00
bors[bot] 155a922d47
Merge #4628 #4639
4628: Disable or fix some spammy new clang-tidy 13 warnings r=heinrich5991 a=def-

```
src/engine/client/backend/opengles/opengles_sl_program.cpp:10:11: warning: suspicious #include of file with '.cpp' extension [bugprone-suspicious-include]
          ^

src/engine/graphics.h:330:67: warning: 2 adjacent parameters of 'CFreeformItem' of similar type ('float') are easily swapped by mistake [bugprone-easily-swappable-parameters]
                CFreeformItem(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) :
                                                                                ^~~~~~~~~~~~~~~~~~

src/game/editor/layer_tiles.cpp:1802:14: warning: result of multiplication in type 'int' is used as a pointer offset after an implicit widening conversion to type 'ptrdiff_t' [bugprone-implicit-widening-of-multiplication-result]
                        mem_zero(&m_pSwitchTile[y * m_Width], o * sizeof(CSwitchTile));
                                  ^

src/game/server/entities/plasma.cpp💯152: warning: operator has equivalent nested operands [misc-redundant-expression]
        if(SnapPlayer && SnapPlayer->GetTeam() != TEAM_SPECTATORS && !SnapPlayer->IsPaused() && SnapChar && SnapChar && SnapChar->Team() != m_ResponsibleTeam && SnapPlayer->m_ShowOthers != 1)
                                                                                                ~~~~~~~~    ~~~~~~~~                                          ^

src/game/editor/editor.cpp:4295:38: warning: The right operand of '>' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
                        if(m_FilePreviewImageInfo.m_Width > Preview.w)
                                                          ^ ~~~~~~~~~
```
<!-- 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)


4639: Fix SendStartWarning() to only warn every 3 seconds r=heinrich5991 a=def-

Thanks for Skeith for report

<!-- 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: def <dennis@felsin9.de>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-01-26 13:17:54 +00:00
Dennis Felsing 0374ddac72 Don't clamp "zoom" command, we already clamp in ChangeZoom
Thanks to chillerdragon for noticing
2022-01-26 12:54:19 +01:00
heinrich5991 b92f794e3e Fix old-style DDNet version message sending
Forgot to invert a condition in
49bc150afd.

Fixes #4629.
2022-01-24 15:29:04 +01:00
Dennis Felsing 827ebf1ce6 Emote -> Emoticon 2022-01-23 19:16:23 +01:00
Dennis Felsing 4da76e0e7d Fix any_of 2022-01-23 18:56:37 +01:00
def 94272f82c7 Add more readability checks 2022-01-22 17:45:25 +01:00
def 3f7befdd8b Add some further readability checks, mostly redundancy
/media/ddnet/src/engine/server/databases/sqlite.cpp:232:55: warning: the address of ‘char* sqlite3_expanded_sql(sqlite3_stmt*)’ will never be NULL [-Waddress]
  232 |         if(m_pStmt != nullptr && sqlite3_expanded_sql != nullptr)
      |                                  ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
2022-01-22 17:22:01 +01:00
def bc78ba57b9 Enable readability-inconsistent-declaration-parameter-name 2022-01-22 14:12:59 +01:00
def 7aac8b5386 Add readability-container-size-empty 2022-01-22 13:54:25 +01:00
def bcb50c1b29 Enable readability-const-return-type, readability-container-data-pointer, readability-delete-null-pointer 2022-01-22 13:49:14 +01:00
def 653c7715a5 Add readability-avoid-const-params-in-decls 2022-01-22 13:44:22 +01:00
bors[bot] 623d8af04c
Merge #4623
4623: Refactor: Distinguish between two concepts previously called "Dummy" r=def- a=heinrich5991

On the one hand variables called "Dummy" would tell us whether the
current action refers to the currently inactive tee ("dummy"). On the
other hand, these variables could tell us whether the current action
refers to the main connection to the server, or the secondary one. The
latter use case is now renamed to "Client", with the choices
`CLIENT_MAIN`, `CLIENT_DUMMY` (and `CLIENT_CONTACT`).

Perhaps better names could be found, especially since `Client` also
refers to the engine client class in the game code.

Also fix a few bugs in dummy handling.

## 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: heinrich5991 <heinrich5991@gmail.com>
2022-01-21 21:26:21 +00:00
heinrich5991 d2bf8d6513 Rename Client to Conn (suggestion by deen) 2022-01-21 22:13:35 +01:00
bors[bot] 390e54f627
Merge #4625
4625: Use ETextAlignment enum for UI r=def- a=ChillerDragon

Replaces the magic numbers -1/0/1 for left/center/right

Based on the work done in upstream:

`@cinaera` added alignment enums
	04ee8b20a1

`@TsFreddie` renamed them
	67651e8122

## 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: ChillerDragon <ChillerDragon@gmail.com>
2022-01-21 15:39:36 +00:00
ChillerDragon b770bc6988 Use ETextAlignment enum for UI
Replaces the magic numbers -1/0/1 for left/center/right

Based on the work done in upstream:

@cinaera added alignment enums
	04ee8b20a1

@TsFreddie renamed them
	67651e8122
2022-01-21 16:26:19 +01:00
ChillerDragon 41fd1639d9 Limit evolving to 3 seconds
Took from upstream
5d44714e92 (diff-597779b4eb51af9adfedd04b8a235afff01091a4ba741daa604cb5cbeda4e3daR1306-R1321)
2022-01-21 11:30:31 +01:00
heinrich5991 49bc150afd Refactor: Distinguish between two concepts previously called "Dummy"
On the one hand variables called "Dummy" would tell us whether the
current action refers to the currently inactive tee ("dummy"). On the
other hand, these variables could tell us whether the current action
refers to the main connection to the server, or the secondary one. The
latter use case is now renamed to "Client", with the choices
`CLIENT_MAIN`, `CLIENT_DUMMY` (and `CLIENT_CONTACT`).

Perhaps better names could be found, especially since `Client` also
refers to the engine client class in the game code.

I tried to not fix bugs unless it would complicate the code.
2022-01-21 01:54:14 +01:00
bors[bot] 6d3aaaeff9
Merge #4622
4622: Refactoring: move RenderTilemapGenerateSkip to CLayers, Add CLayers::NumLayers r=def- a=Robyt3

- Move `CRenderTools::RenderTilemapGenerateSkip` to `CLayers::InitTilemapSkip`, as it can be a private function in `CLayers`.
- Add missing `CLayers::NumLayers` accessor.
- Improve code style.

## 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
- [X] 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 <robert.mueller@uni-siegen.de>
2022-01-20 21:54:42 +00:00
ChillerDragon e4be3f5241 Shutdown components 2022-01-20 12:20:29 +01:00
Robert Müller 1810ff3949 Move InitTilemapSkip to CLayers 2022-01-19 22:22:31 +01:00
Robert Müller 39b716d5ab Fix double clicking on folders in demo browser 2022-01-19 21:45:47 +01:00
bors[bot] 48e53470cd
Merge #4581 #4590 #4593 #4607
4581: Adjustable prediction margin r=def- a=trml

This adds an option to adjust how early the client sends an input for a given tick. In vanilla this value is hardcoded to 10 milliseconds before the next tick, which is good for low-latency gameplay and/or when you have a stable connection, but sometimes it could perhaps be useful to increase the value, to either test something with a high ping (without having to joing a high-ping server or use on a 3rd party program like tc/netem), or for counteracting the effect of jitter and jumping ping.

The last part comes at a tradeoff for higher ping though, and it also doesn't handle lag caused by packet loss, but it I have found it useful in some situations when playing race/solo/dummy with a bad connection. Since it's a bit experimental I only added it as an f1 option and not stored between sessions, and also added a gameinfo flag to only support it on servers that implement #1441.

Edit: Also attempted to cleanup variable names for tick calculations in client.cpp slightly.

## 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
- [x] 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)


4590: Remove extra projectiles r=def- a=trml

Aligns the code with vanilla, and cleans up things a bit
(same as [329e6261f3](url))

These were used to show projectiles a tick (or fraction of a tick) earlier than they otherwise would (and they were also sent without extrainfo since they didn't matter for prediction), so removing them would perhaps not make a noticeable difference. (and perhaps also less of a difference now since weapon input isn't applied before the start of a tick anymore).

## 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)


4593: Fix compiler warning with new ffmpeg version (currently built from git) r=heinrich5991 a=def-

```
src/engine/client/video.cpp:102:32: error: assigning to 'AVOutputFormat *' from 'const struct AVOutputFormat *' discards qualifiers
        m_pFormat = m_pFormatContext->oformat;
                    ~~~~~~~~~~~~~~~~~~^~~~~~~
src/engine/client/video.cpp:571:13: error: assigning to 'AVCodec *' from 'const AVCodec *' discards qualifiers
        *ppCodec = avcodec_find_encoder(CodecId);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
<!-- 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)


4607: Adopt upstream input (especially double click) handling, refactoring r=def- a=Robyt3

This adopts the 0.7 way of handling double clicks, by checking `Event.button.clicks` of the `SDL_Event`. The double click is stored as a flag which is cleared when the `MouseDoubleClick()` function is called (d215c73206 and 7977b46d36).

This reverts 72a6e20, as this hack is no longer required (closes #1745). Double clicking a friend in the friend list still works (#444) with both `gfx_asyncrender_old 0` and `1`.

Refactorings and minor fixes synchronizing with upstream:

- Only copy SDL keystate of _keyboard_ keys and mem_zero the rest to ensure out of bounds SDL keys don't trigger mouse keys.
- Rename variables and use SDL constants.
- Reduce unnecessary indentation.

## 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
- [X] Considered possible null pointers and out of bounds array indexing
- [X] 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: trml <trml@users.noreply.github.com>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
Co-authored-by: Robert Müller <robert.mueller@uni-siegen.de>
Co-authored-by: oy <Tom_Adams@web.de>
2022-01-17 23:36:14 +00:00
bors[bot] e03e6210e0
Merge #4604
4604: Allow multiple comands when adding vote in UI r=heinrich5991 a=def-

as reported by louis

<!-- 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: def <dennis@felsin9.de>
2022-01-17 02:10:34 +00:00
def 7e7fac82da Escape voting commands sent from client 2022-01-17 00:41:47 +01:00
trml b391e4b50d Fix bullet rendered through walls 2022-01-16 21:58:51 +01:00
Robert Müller c214918977 only consume double click if item hot 2022-01-16 12:43:32 +01:00
def 746fc307aa Allow multiple comands when adding vote in UI
as reported by louis
2022-01-16 10:43:35 +01:00
bors[bot] b0f6b805d3
Merge #4583
4583: Update score hud immediately when switching dummy r=Jupeyy a=def-

<!-- 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: def <dennis@felsin9.de>
2022-01-15 18:27:42 +00:00
bors[bot] dcc912d317
Merge #4602
4602: Fix windows macro and split the resize events r=def- a=Jupeyy

I noticed that the resize backend used the wrong macros `CONF_PLATFORM_WINDOWS` instead `CONF_FAMILY_WINDOWS`(windows seems to be the only one in detect.h that splits platform between 32bit and 64bit, maybe we should change that)

maybe this fixes #4351, because actually the workaround for windows was exactly inside the wrong macro to fix resizing in fullscreen.

I also split the resize functions, so its less confusing Resize (actively resize in the resolution list) vs GotResized (reported by SDL) and made some things a bit clearer

## 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: Jupeyy <jupjopjap@gmail.com>
2022-01-15 16:17:15 +00:00
Jupeyy 69202fdc22 Fix windows macro and split the resize events 2022-01-15 16:55:32 +01:00
bors[bot] 2d48cf7dcb
Merge #4573
4573: Implemented live freeze (tiles LFREEZE and LUNFREEZE) r=def- a=GiuCcc

Implemented live freeze.
Live frozen tees cannot move or jump, but they can use hook and weapons.
Live freeze permit the reverse-hammerfly: above tee is live frozen, so it can only hook, not drive. Lower tee has to hammer and drive.

It's implemented adding a new flag: CHARACTERFLAG_NO_MOVEMENTS.
Two tiles are 144 (LFREEZE) and 145 (LUNFREEZE) must be added as entities <--- MISSING ARTWORK HERE
Backcompatibily in-game has been tested, but missing cosmetic on old client: live frozen tee should have smoke too.
I've not tested the back-compatibility about save or rescue.

Added popup gametile in editor: live freeze and live unfreeze.
Added fix in editor explanation: classic TILE_FREEZE and TILE_UNFREEZE can be placed in switch layer too.

TODO:
Missing entities artwork for Tile 144 (LFREEZE) and 145 (LUNFREEZE)

## 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
- [ ] 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: Wohoo <giu.casuccio@gmail.com>
2022-01-15 10:27:04 +00:00
Jupeyy 956afed264 Fix console line bug when resizing 2022-01-14 22:36:41 +01:00
trml 30093e44c5 Remove extra projectiles 2022-01-13 00:46:11 +01:00
def e78b1188e0 Update score hud immediately when switching dummy 2022-01-09 22:16:42 +01:00
Wohoo 68a8bbadbc clang-format fix 2022-01-08 12:30:51 +01:00
Wohoo 0614fce2bb Remove comment 2022-01-07 17:12:57 +01:00
Wohoo 2017464282 Livefreeze implementation with CHARACTERFLAG_NO_MOVEMENTS flag.
Freeze and Unfreeze tiles added to switch layer too.
2022-01-07 16:53:40 +01:00
def 11d619e060 Use power button to quit (fixes #3786) 2021-12-29 11:16:41 +01:00
heinrich5991 228125df4f Remove compatible version filter
It doesn't do anything right now, all servers advertise a compatible
version.

It might become a compatibility hazard in the future, e.g. DDNet servers
try to advertise a different version string to 0.6 than to 0.7 clients,
because the compatible version filter on 0.6 insists that it starts with
"0.6" and on 0.7 that it starts with "0.7", clearly incompatible.
2021-12-28 15:09:38 +01:00
def bc184b7198 Add margin for ping in server browser
as reported by Izanagi
2021-12-28 01:05:53 +01:00
bors[bot] d4f126810b
Merge #4484 #4486
4484: Add IStorage::FormatTmpPath static method r=heinrich5991 a=def-

Not sure I prefer it, but now it's done. Any opinions?

<!-- 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)


4486: Add .a files to .gitignore r=def- a=heinrich5991

<!-- 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: def <dennis@felsin9.de>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-12-21 10:30:12 +00:00
bors[bot] 51d930800c
Merge #4497
4497: Fix run_on_join being run on normal player again (fixes #4494) r=heinrich5991 a=def-

<!-- 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
- [x] Considered possible null pointers and out of bounds array indexing
- [x] 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>
2021-12-21 03:50:11 +00:00
def 57ebf33b1a Center cl_show_direction (fixes #4495) 2021-12-20 23:34:49 +01:00
def 2963c30755 Fix run_on_join being run on normal player again (fixes #4494) 2021-12-20 23:19:43 +01:00
def d91d20f079 Add a hint for "Run on join"
Otherwise it's not clear if you can run client commands (f1) or chat
commands (/). As reported by cheeser0613
2021-12-20 18:58:15 +01:00
def 1a02a20fa6 Add IStorage::FormatTmpPath static method
Not sure I prefer it, but now it's done. Any opinions?
2021-12-20 16:12:15 +01:00
bors[bot] ec0d1172eb
Merge #4481
4481: Don't create cut off UTF-8 sequences on string manipulation r=def- a=heinrich5991

CC #4463
CC #4465 

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [x] 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: heinrich5991 <heinrich5991@gmail.com>
2021-12-20 08:58:55 +00:00
heinrich5991 58533cddef Fix string functions not to truncate in the middle of a UTF-8 character
This makes `str_utf8_copy` obsolete.
2021-12-20 02:34:02 +01:00