Commit graph

15170 commits

Author SHA1 Message Date
bors[bot] d0af85d4b2
Merge #5546
5546: Remove unused `#include <windows.h>` in engine client r=Jupeyy a=Robyt3

<!-- 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: Robert Müller <robytemueller@gmail.com>
2022-07-02 12:15:41 +00:00
Robert Müller 8ee821c2f0 Remove unused #include <windows.h> in engine client 2022-07-02 14:02:42 +02:00
bors[bot] e7c3f108ef
Merge #5542
5542: Fix HUD on KOG and do no longer show new DDRace HUD on old DDRace Servers r=def- a=C0D3D3V

I tested it on KOG and some other servers. Seems fine

I personally would have shown the new HUD also on old server. But I guess it is fine to show the old HUD on old servers.


If we decide for this solution... we can merge it also into 16.2 so that a HUD is shown on KoG servers

## 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-07-01 12:56:29 +00:00
c0d3d3v f5519d1d88
Fix HUD on server we think that they are DDRace, but they are not 2022-07-01 13:13:06 +02:00
bors[bot] 2cba4dd768
Merge #5541
5541: Fix player input player flags translation with sixup, fix player flags output of `status` command r=def- a=Robyt3

Closes #5220.

## 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: Robert Müller <robytemueller@gmail.com>
2022-06-30 22:12:37 +00:00
Robert Müller f3fbe891a6 Fix player input player flags translation with sixup
The sixup translated player flags were previously applied in `OnDirectInput` directly to the player input data.
However, the input data has already been copied at that point, so predicted inputs were using the incorrect flags.
This is fixed by moving the player flags translation to `OnClientPrepareInput`, which is called first and only once on each new player input before it is copied.
2022-07-01 00:00:17 +02:00
c0d3d3v 6869530314
Rename IsTCheckpoint to IsTeleCheckpoint and IsXCheckpoint to IsFTimeCheckpoint. And reduce code duplication 2022-07-01 00:00:03 +02:00
Robert Müller 6d0806f99d Fix engine client flags not being updated under some conditions
The flags were only being updated based on rather arbitrary conditions, so they could never reset to zero or reduced.
The flags are now always updated. The flags are only used in the output of the `status` command.
2022-06-30 23:55:03 +02:00
c0d3d3v 0bfb854a0e
Rename TILE_CHECKPOINT_XXX to TILE_TIME_CHECKPOINT_XXX 2022-06-30 23:41:40 +02:00
bors[bot] 747fe9308f
Merge #5540
5540: Minor refactoring: Fix variable names and use sizeof in CMapImages r=Jupeyy a=Robyt3


## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2022-06-30 18:07:04 +00:00
Robert Müller d9b0304adb Use sizeof instead of constant 2022-06-30 19:46:33 +02:00
Robert Müller d5594d8bd6 Fix variable name EntitesAreMasked -> EntitiesAreMasked 2022-06-30 19:45:10 +02:00
Robert Müller 3c7847a8d9 Fix variable name WasUnknwon -> WasUnknown 2022-06-30 19:44:29 +02:00
bors[bot] 21178e22e9
Merge #5538
5538: fix typo and comment r=def- a=luk51

just found a variable lasterOutlineColor instead of laserOutlineColor + double comment

## 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: luk <lsk@posteo.de>
2022-06-30 15:41:34 +00:00
luk 1c340daeaa fix typo and comment 2022-06-30 17:04:29 +02:00
bors[bot] 5e7ec64292
Merge #5486
5486: Switch to loading screen, when map creation takes too long r=def- a=Jupeyy

Same as #4941 

It doesn't directly fix the issue described in #5478, it does however not trigger it anymore. it's still a bug in our code unrelated  to this. This just triggered the UB from the issue as  `@ardadem` confirmed, SDL received a SDL_QUIT (`[2022-06-23 20:26:31][test]: sdl closed my client, but why xd`)

Now we have a confirmed case that making the window unresponsive can create weird behavior. Similar to the other pr switch to a loading screen after 500ms (this time without menu background map tho, since the menu background map calls the same code).

We really need some fancy loading screen for such situations, even tho they are rare xD

## 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-06-30 14:36:58 +00:00
bors[bot] 5e0eada302
Merge #5517
5517: Add APPEARANCE Settings page r=def- a=C0D3D3V

This could potentially also be added to 16.2

I also renamed  `cl_ddrace_hud` to `cl_showhud_ddrace` and ` cl_show_jumps_indicator` to `cl_showhud_jumps_indicator` I guess that fits better the pattern of the other configs.

![grafik](https://user-images.githubusercontent.com/14315968/175836449-eb74410c-df35-4177-ad42-be13a9593af8.png)

![grafik](https://user-images.githubusercontent.com/14315968/175836467-0e2ff022-8da7-468f-9df5-bb564e0f15f5.png)

![grafik](https://user-images.githubusercontent.com/14315968/176675550-c7adde7b-1c3a-4a0c-bcd6-945c9115c771.png)
![grafik](https://user-images.githubusercontent.com/14315968/176675586-8fb5645e-32a8-4276-ad6a-cac1dfbc3e67.png)

### for the following 3 tabs there is now room to add a preview in future
![grafik](https://user-images.githubusercontent.com/14315968/176675629-5470d864-c13d-492a-9064-3b5a3743253b.png)
![grafik](https://user-images.githubusercontent.com/14315968/176675677-f973bea8-31b4-4a00-85a9-1175b8fdea2f.png)
![grafik](https://user-images.githubusercontent.com/14315968/176675731-04ea48b2-ec18-4a0f-a4b5-48fe7c9dcd34.png)
![grafik](https://user-images.githubusercontent.com/14315968/176675779-70df98df-35da-4018-a81e-e26127492d36.png)

I changed some of the texts ... so please look at them carefully 

## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-06-30 13:03:17 +00:00
c0d3d3v cee071e3f1
The appearance settings page has been revised to look more like the general and DDNet settings page 2022-06-30 14:17:07 +02:00
bors[bot] 2bd1273657
Merge #5514
5514: Update menu music state when the config variables change via console, various refactoring r=heinrich5991 a=Robyt3

Also update the background music when `snd_enable` or `snd_enable_music` change via console or bind. Closes #2911.

For this purpose, add `IsPlaying` method to engine sound and client sound component to check whether a specific sound sample is already playing.

Various refactoring in engine sound.

## 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: Robert Müller <robytemueller@gmail.com>
2022-06-30 11:07:07 +00:00
bors[bot] c345bc6993
Merge #5535 #5536
5535: Updated french language r=def- a=Chairn


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


5536: Fix more unsafe define r=def- a=Chairn

Fix some unsafe define that can expand in an undesired way if used with some bitwise operator (very unlikely though)

## 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: Chairn <chairn.nq@hotmail.fr>
2022-06-30 00:05:36 +00:00
bors[bot] 03c5e6a111
Merge #5537
5537: simplify the snowflake by Ravie r=def- a=C0D3D3V

somebody complained that the snowflake is not very teeish so Ravie thought about a redesign
![grafik](https://user-images.githubusercontent.com/14315968/176554149-3ada6d05-dafa-4c6a-a284-20bb673a3bca.png)

![grafik](https://user-images.githubusercontent.com/14315968/176553895-2378b471-09ef-4e3d-9d94-bfa2ef766553.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
- [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-06-29 23:42:58 +00:00
c0d3d3v 756ef3dac9
simplify the snowflake 2022-06-30 00:02:51 +02:00
Chairn 96e9364fb0 Fix more unsafe define 2022-06-29 23:52:03 +02:00
Chairn f908e4a182 Updated french language 2022-06-29 21:28:27 +02:00
c0d3d3v a26285c052
Add cl_nameplates_strong to settings page 2022-06-29 16:28:27 +02:00
c0d3d3v 281c766117
Add APPEARANCE Settings page 2022-06-29 16:28:19 +02:00
bors[bot] cbab1fb912
Merge #5533
5533: revert to send server messages for now r=def- a=C0D3D3V


![grafik](https://user-images.githubusercontent.com/14315968/176440520-5f192f17-b2c1-4140-b27a-b59c73a05349.png)

send our old server messages till we come up with a better way to tell the player some effects on him have changed. See https://github.com/ddnet/ddnet/issues/5510

## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-06-29 12:59:38 +00:00
c0d3d3v 435b7ab489
revert to send server messages for now 2022-06-29 14:46:23 +02:00
bors[bot] 1743b7ce67
Merge #5210
5210: Move ddnet character display info in ddnet character r=def- a=C0D3D3V

- I also added the default value mechanic for Net Objects that have set `validate_size=False`
- I removed the ramp value from the snap, because currently all maps use the default tuning parameters for it
- I renamed `m_FreezeTick` to `m_FreezeStart` 

- Added Extended Net Objects to the debug HUD (Also added a Headline):
![grafik](https://user-images.githubusercontent.com/14315968/175284419-3014bc06-96a0-407d-b170-15e06350caa7.png)
(out of range) is in the screenshot the old DDNetCharacterDisplayInfo

fixes #5455

## 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-06-29 11:35:37 +00:00
bors[bot] 7a0a0e006d
Merge #5532
5532: Update hungarian.txt r=def- a=bencie

16.2-rc4 translations (missing: Aim bind, Show freeze bars, Opacity of freeze bars inside freeze )

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: bencie <78111412+bencie@users.noreply.github.com>
2022-06-29 10:09:42 +00:00
bencie fb22a1c2ea
Update hungarian.txt
16.2-rc4 translations (missing: Aim bind, Show freeze bars, Opacity of freeze bars inside freeze )
2022-06-29 11:54:52 +02:00
Dennis Felsing f1cff70e1b
Merge pull request #5530 from zigtfm/master
Update russian.txt
2022-06-29 10:43:41 +02:00
bors[bot] 861dfdf88c
Merge #5531
5531: Editor envelope preview: fix last point not being editable, fix movement of envelope points in Info mode (Ctrl+I) r=def- a=Robyt3

Port two fixes for the editor envelope preview from upstream:
1. Make it possible to edit the last envelope point.
2. Fix envelope points being moved incorrectly when grabbed with the mouse. Closes #1984.

## 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: BeaR <cinaera@web.de>
Co-authored-by: Robert Müller <robytemueller@gmail.com>
2022-06-28 22:14:22 +00:00
Robert Müller 4534996fbc Fix movement of envelope points with Info (Ctrl+I)
Co-authored-by: oy <tom_adams@web.de>
2022-06-28 22:25:55 +02:00
Robert Müller a765abf8e6 Merge IgnoreGrid variable declarations and definitions 2022-06-28 22:06:24 +02:00
BeaR b25c094daa Envelope preview: make last point editable 2022-06-28 19:29:09 +02:00
bors[bot] cf26658776
Merge #5529
5529: Print font name instead of address in log message, `pFont` -> `font` r=def- a=Robyt3



## 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: Robert Müller <robytemueller@gmail.com>
2022-06-28 15:57:27 +00:00
Robert Müller 16d9a69dd5 Print font name instead of address in log message, pFont -> font 2022-06-28 17:48:41 +02:00
zigtfm a26c7a05c9 Update russian.txt
added missing translations
2022-06-28 20:42:46 +05:00
Robert Müller b8d6298e29 Rename OpusFile to pOpusFile 2022-06-28 17:38:38 +02:00
Robert Müller d8e72ad862 Handle op_read errors and EOF 2022-06-28 17:38:05 +02:00
bors[bot] 284b6cdd86
Merge #5528
5528: Sort CI logs before diff to fix race condition r=heinrich5991 a=ChillerDragon

Logging to file and to stdout might order differently
due to multiple threads

Should fix issues like these

```
[-] Error: logfile 'server.log' differs from stdout
--- server.log	2022-06-28 13:46:38.703149594 +0000
+++ stdout_server.txt	2022-06-28 13:46:38.703149594 +0000
`@@` -150,8 +150,8 `@@`
 [2022-06-28 13:46:30][sql]: SQLite statement: INSERT OR IGNORE INTO record_race(	Map, Name, Timestamp, Time, Server, 	cp1, cp2, cp3, cp4, cp5, cp6, cp7, cp8, cp9, cp10, cp11, cp12, cp13, 	cp14, cp15, cp16, cp17, cp18, cp19, cp20, cp21, cp22, cp23, cp24, cp25, 	GameID, DDNet7) VALUES ('coverage', 'client1', DATETIME('2022-06-28 13:46:30', 'utc'), 1.18, 'UNK', 	0.44, 0.52, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 	0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 	0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 	'41c154ac-326f-41b6-bc30-11534f5026ec', 0)
 [2022-06-28 13:46:30][sql]: save score done on write database 0
 [2022-06-28 13:46:31][server]: player has entered the game. ClientID=1 addr=<{[::1]:31439}> sixup=0
-[2022-06-28 13:46:31][sql]: load player data done on read database 0
 [2022-06-28 13:46:31][chat]: *** 'client2' entered and joined the game
+[2022-06-28 13:46:31][sql]: load player data done on read database 0
 [2022-06-28 13:46:31][ddnet]: cid=1 version=16020
 [2022-06-28 13:46:33][chat]: 0:-2:client1: hello world
 [2022-06-28 13:46:33][server]: ClientID=0 authed with key=default_admin (admin)
 ```

Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
2022-06-28 14:29:57 +00:00
ChillerDragon 28c4a8a346 Sort CI logs before diff to fix race condition
Logging to file and to stdout might order differently
due to multiple threads
2022-06-28 16:26:40 +02:00
bors[bot] ecca7b7a6e
Merge #5525
5525: Only apply size and color if changed, when editing multiple layers r=heinrich5991 a=Robyt3

To prevent the color of all layers from being reset to zero when changing just the size.

Closes #3734.

## 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: Robert Müller <robytemueller@gmail.com>
2022-06-27 21:42:52 +00:00
Robert Müller ac40efa263 Only apply size and color if changed, when editing multiple layers
To prevent the color of all layers from being reset to zero when changing just the size.
2022-06-27 23:20:09 +02:00
Robert Müller 70866d6d0c Fix names of SCommonPropState member variables 2022-06-27 23:20:09 +02:00
bors[bot] c231084daf
Merge #5515
5515: Include config info in help r=heinrich5991 a=def-

So it is clear what the default is

![screenshot-20220627@000811](https://user-images.githubusercontent.com/2335377/175835563-dd2abc4f-df83-43a7-bb60-7597d498aab7.png)
![screenshot-20220627@000545](https://user-images.githubusercontent.com/2335377/175835566-c983aa93-4a1d-471a-b183-1068050d196f.png)
![screenshot-20220627@000519](https://user-images.githubusercontent.com/2335377/175835569-796bcc4c-f9d2-4949-b1d5-b6dbb03be6d9.png)


## Checklist

- [x] Tested the change ingame
- [x] 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: def <dennis@felsin9.de>
2022-06-27 17:41:08 +00:00
bors[bot] 2603b38528
Merge #5522
5522: Fix unsafe defines r=heinrich5991 a=Chairn

These are unsafe define that should be parenthesized due to operator precedency that can change operation order in expression such as:
```c++
#define ABCD 1 + 2
int foo = 36/ABCD; // foo is actually 38 and not 12
```

I didn't change engine/client/graphics_threaded/h as it is included in https://github.com/ddnet/ddnet/pull/5520

## 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: Chairn <chairn.nq@hotmail.fr>
2022-06-27 17:19:28 +00:00
Chairn a9ee57aeb7 Fix unsafe defines 2022-06-27 18:51:02 +02:00
Robert Müller 2e200c834d Use consistent sizeof expression for Mix calls 2022-06-27 17:55:28 +02:00