Commit graph

7803 commits

Author SHA1 Message Date
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] b0faac4a98
Merge #4784
4784: fix 4781 and refactor of the client id for server demos r=def- a=C0D3D3V

#Fixes #4781

I took the opportunity and directly refactored the code a bit, to be exact I replaced the -1 with the enum `SERVER_DEMO_CLIENT`, I can also change the identifier if we want to call it something else. Further I normalized the corresponding `>= 0` conditions to `> SERVER_DEMO_CLIENT`.


## 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-03-07 18:08:32 +00:00
c0d3d3v 3438642dd8
fix 4781 and refactor of the client id for server demos 2022-03-07 19:03:43 +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
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
c0d3d3v eda6ef899f
SV_TEAM enum was labeled 2022-03-03 15:36:06 +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
bors[bot] 9d8e5f7957
Merge #4751 #4765
4751: Don't try to send messages outside of sv_max_clients (fixes# 4750) 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)


4765: Show correct server address when connecting r=Jupeyy a=def-

This just saved the secret server for BiT3 streaming, but still a bug ;)

## 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-01 14:39:05 +00:00
bors[bot] 4533a3541a
Merge #4763
4763: Quad knife tool r=def- a=HiRavie

A new way to slice quads that doesn't make mappers pull their hair out.
To use it, open the quad context menu and click the _Slice_ button, check out the tooltip for more instructions.
Snaps automatically to corners and edges if close enough or to grid.

![gif](https://user-images.githubusercontent.com/65019210/155854241-9e07a5b2-1915-41d4-86c9-b2084ff6b929.gif)

## 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
- [ ] 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: Ravie <65019210+HiRavie@users.noreply.github.com>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-03-01 10:34:34 +00:00
Dennis Felsing c75139a1ad Fix clang-format and clang-tidy 2022-03-01 11:33:53 +01:00
Ravie 41ea78ac56 Simpler visuals code 2022-02-28 23:45:57 +01:00
Tater 959e7c2763 Fixed specteam 1 not showing teammates while spectating/freecam in solo 2022-02-28 12:47:01 -06:00
Dennis Felsing 3cd7058fe6 Show correct server address when connecting 2022-02-28 19:38:59 +01:00
Ravie 603089754f Some fixes 2022-02-27 00:44:34 +01:00
Ravie 2745c1a694 Knife tool 2022-02-26 18:49:06 +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
Dennis Felsing e2c48ec47e Don't try to send messages outside of sv_max_clients (fixes# 4750) 2022-02-21 16:33:53 +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
c0d3d3v eac2d731b6
Refactoring of g_Config.m_SvTeam, See #4601 2022-02-19 18:11:15 +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
Dennis Felsing bc0bf4e549 No chat messages for live freeze
Since you have visual indication already, as suggested by fokkonaut and
Konsti
2022-02-18 13:02:03 +01:00
Dennis Felsing 18ee351247 Version 15.9.1 2022-02-15 21:20:31 +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 7da9f1b93b Add modernize-use-equals-delete 2022-02-15 00:20:34 +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 62756dbda0 Enable modernize-make-unique clang-tidy check 2022-02-15 00:05:46 +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