Commit graph

14849 commits

Author SHA1 Message Date
Robert Müller ff43b32257 Extract UpdateMouseState function 2022-06-06 22:06:56 +02:00
Robert Müller 9a17617a28 Let IInput::MouseRelative return true if mouse was moved 2022-06-06 22:06:56 +02:00
Robert Müller 92503fccec Add comments, order functions, fix parameter names in engine input 2022-06-06 22:06:55 +02:00
bors[bot] 3ddc4d500b
Merge #5361
5361: Refactoring: Extract CLayerTiles::ShiftImpl, BrushFlipXImpl and BrushFlipYImpl to reduce duplicate code r=heinrich5991 a=Robyt3

There is still more duplicate code but it's tricky to extract.

## 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-06 12:00:09 +00:00
bors[bot] 171ac2007b
Merge #5363
5363: Extract CCmdlineFix to call cmdline_fix and cmdline_free automatically r=def- a=Robyt3

Use `CCmdlineFix` RAII wrapper to encapsulate `cmdline_fix` and `cmdline_free` handling. This fixes memory leaks when client/server/tools exit early, as `cmdline_free` was only called on the happy code path.

## 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-06 11:39:17 +00:00
Robert Müller de199d08c0 Fix doxygen comments 2022-06-06 12:50:08 +02:00
Robert Müller e6bd84d4fd Extract CCmdlineFix to call cmdline_fix and cmdline_free automatically 2022-06-06 12:46:58 +02:00
Robert Müller e0e1f49530 Extract BrushFlipXImpl and BrushFlipYImpl 2022-06-06 11:29:52 +02:00
Robert Müller 19e97829ce Extract CLayerTiles::ShiftImpl 2022-06-06 10:59:36 +02:00
bors[bot] d49b7b1561
Merge #5351
5351: Refactoring: Use MultiByteToWideChar instead of str_utf16le_encode r=heinrich5991 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-06 08:41:14 +00:00
Robert Müller fca867702e Add error messages when log message encoding cannot be converted 2022-06-06 10:28:47 +02:00
bors[bot] 62c13f2504
Merge #5360
5360: Don't write null byte r=heinrich5991 a=def-

Thanks to heinrich5991 for noticing: https://github.com/ddnet/ddnet/pull/5341#pullrequestreview-996061345

<!-- 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-06-06 08:22:34 +00:00
bors[bot] ae8e82e138
Merge #5359
5359: Fix input getter for dummy r=def- a=trml

Bug reported on discord by Broso56 that dummy is wrongly predicted with deepfly (and when standing still).

Looked at it and found that it was caused by GetInput not returning the dummy input as intended. (Before my last pr a different getter was used, which didn't have that problem)

## 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: trml <trml@users.noreply.github.com>
2022-06-06 07:48:41 +00:00
def 8623381529 Don't write null byte
Thanks to heinrich5991 for noticing
2022-06-06 09:47:12 +02:00
trml 2b48c376d6 Fix input getter for dummy 2022-06-06 04:17:55 +02:00
bors[bot] ef5501c4da
Merge #5332
5332: Pass output parameter to WriteFile that is required on Windows 7 r=heinrich5991 a=Robyt3

Maybe closes #5322. I can't reproduce the crash. Can you try if this fixes it, `@Chairn?`

Looks like Windows 7 needs this parameter.

Alternative to #5331.

## 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-05 20:52:42 +00:00
bors[bot] eb92852adf
Merge #5344
5344: Log rcon messages (fixes #5342) 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-06-05 20:32:12 +00:00
Robert Müller 3dd2df285a Use MultiByteToWideChar instead of str_utf16le_encode 2022-06-05 20:51:56 +02:00
bors[bot] 152ee93e16
Merge #5347
5347: Fix deleting envelopes not updating sounds r=def- a=C0D3D3V

Original fix by Ravie... updated to latest code

I do not really know how to trigger the bug, but for me adding and deleting sounds to the map, worked.... Since it is only the updated version from Ravie I think it works
`@HiRavie` maybe you can test it again

## 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-06-05 15:20:58 +00:00
c0d3d3v 52b717f848
Fix deleting envelopes not updating sounds 2022-06-05 15:21:00 +02:00
bors[bot] 94c5f0df32
Merge #5341
5341: Don't write aAnsi when it's not filled (fixes #5340) r=C0D3D3V 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-06-05 11:51:00 +00:00
def af3b1bb0e7 Log rcon messages (fixes #5342) 2022-06-05 12:44:15 +02:00
def ea5999d1da Don't write aAnsi when it's not filled (fixe #5340) 2022-06-05 11:30:54 +02:00
bors[bot] b554039740
Merge #5320
5320: Fix prediction input timing r=def- a=trml

Fixes #5307 by updating the prediction to use the new input handling from #5032, and also removed some now no longer used code.

## 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: trml <trml@users.noreply.github.com>
2022-06-04 22:37:03 +00:00
bors[bot] 54359326cf
Merge #5337
5337: Refactor tools r=def- a=Robyt3

- Fix/improve variable names.
- Move variable declarations.
- ~~Use `class` instead of `struct` (https://github.com/ddnet/ddnet/issues/5297#issuecomment-1144250491).~~
- Use `nullptr` instead of `0`.
- Pass `nullptr` to `GetItem` when output value is unused.
- Add null-checks for storage.
- Add missing checks for layer type in `map_diff` tool.

## 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-04 17:26:04 +00:00
Robert Müller fda98a3ef4 Rename variables and use class in crapnet tool 2022-06-04 17:21:27 +02:00
Robert Müller 7fa3bb0842 Rename variables and use class in config_common.h 2022-06-04 17:21:26 +02:00
Robert Müller 8258effb33 Move/rename variable declarations in config_store 2022-06-04 17:21:26 +02:00
Robert Müller e8bd26857b Move/rename variable declarations in config_retrieve 2022-06-04 17:21:26 +02:00
Robert Müller 081881efcc Move variable declaration in dilate tool 2022-06-04 17:21:26 +02:00
Robert Müller 1f51e6e06a Fix variable name in dummy_map tool, add storage check 2022-06-04 17:21:26 +02:00
Robert Müller fbfbc78be4 Move/rename variable declarations in map_extract tool 2022-06-04 17:21:25 +02:00
Robert Müller 4bc1aeeb7a Move/rename variable declarations in map_convert_07 tool 2022-06-04 17:21:25 +02:00
Robert Müller d9848728e3 Move/rename variable declarations in map_diff tool, add checks 2022-06-04 17:21:25 +02:00
Robert Müller de3bb1ca8c Move/rename variable declarations in map_replace_image tool 2022-06-04 17:21:25 +02:00
Robert Müller 3003608e40 Move/rename variable declarations in map_resave tool 2022-06-04 17:21:25 +02:00
Robert Müller 1505fbe026 Move/rename variable declarations in map_optimize tool 2022-06-04 17:21:24 +02:00
bors[bot] 926d158abc
Merge #5335
5335: Unfreeze character after teleporting in practice r=def- a=hus3h

From my experience and seeing others play, this would be more convenient. Currently teleporting (while being frozen) to retry a part that doesn't have much space or a platform to stand on is a bit hard, often requiring the player to teleport quickly to a position in air multiple times till the character is unfrozen or teleporting to a different part till the character is ready to be put in the original part again. This can also save some time when practicing in general, and will make /tp feel more like /r. This was added only for the /tp command so it shouldn't affect other teleportation methods.
Something to note is that the character teleported into freeze will have the 1 tick unfreeze to jump or so, but it's practice mode so doesn't seem like something to consider.

## 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: hus3h <39054982+hus3h@users.noreply.github.com>
2022-06-03 21:44:35 +00:00
hus3h db529318ab Unfreeze character after teleporting in practice 2022-06-03 21:31:30 +03:00
bors[bot] 36d0c0dcb4
Merge #5334
5334: fix pixel porridge in freeze and ninja bar r=Jupeyy a=C0D3D3V

fixes #5319

## 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-03 16:31:26 +00:00
c0d3d3v c33e0c124e
fix pixel porridge in freeze and ninja bar 2022-06-03 18:27:30 +02:00
bors[bot] 4ead727692
Merge #5330
5330: Actually fix capital /WHISPER r=Jupeyy a=def-

As reported by kiwq

<!-- 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-06-03 14:55:30 +00:00
Robert Müller e5d2b815eb Pass output parameter to WriteFile that is required on Windows 7 2022-06-03 15:55:57 +02:00
Dennis Felsing 9807625ca4 Actually fix capital /WHISPER
As reported by kiwq
2022-06-03 15:26:35 +02:00
bors[bot] 537be53fc2
Merge #5329
5329: Let the names in the mini score hud overflow to the left r=def- a=C0D3D3V

## 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-03 12:48:50 +00:00
c0d3d3v 090ae5e170
Let the names in the mini score hud overflow to the left 2022-06-03 13:57:39 +02:00
bors[bot] ce795572d2
Merge #5327
5327: Add CLockScope r=heinrich5991 a=def-

Remove unused lock and scope in threading.h

Not sure if this is preferred

We could also try switching to std::mutex and lock_guard

<!-- 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-06-03 10:58:17 +00:00
bors[bot] 6b7554f306
Merge #5325
5325: Reset colors at end of line (fixes #5324) r=heinrich5991 a=def-

`@ChillerDragon` Can you test this?

## 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-06-03 10:32:26 +00:00
Dennis Felsing 129205d6b9 Reset colors at end of line (fixes #5324) 2022-06-03 12:22:37 +02:00
Dennis Felsing 51909c19ab Add CLockScope
Remove unused lock and scope in threading.h

Not sure if this is preferred

We could also try switching to std::mutex
2022-06-03 12:21:23 +02:00