Commit graph

8127 commits

Author SHA1 Message Date
trml 85e86772b2 Don't keep track of characters in the predicted gameworld that are not in the snapshot and require pred characters to be alive 2022-05-28 00:07:31 +02:00
trml 2402edcb8a Remove predicted character from gameworld before calling base class destructor 2022-05-26 19:08:46 +02:00
bors[bot] 3b81157013
Merge #5231
5231: Fix windows crash r=def- a=C0D3D3V

Fixes #5226

I tested it in a Windows VM.
`@sjrc6` is it correct that `TempCore` is this way zero initialized, can you check that maybe in the debugger? I do not want to change the behaviour, even tho the core is read in two lines later with `TempCore.ReadCharacter(pCharacter);`

## 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-05-26 08:57:22 +00:00
c0d3d3v 62cad6ba51
use value initialization in Evolve lambda 2022-05-26 08:26:27 +02:00
c0d3d3v cf03ada052
revert to SetHookedPlayer in ReadCharacterCore 2022-05-26 07:45:34 +02:00
Dennis Felsing 68bcd21eff asan+ubsan clean 2022-05-26 01:22:14 +02:00
Dennis Felsing 604142da3a Try other fix for tautological 2022-05-26 00:37:33 +02:00
Zwelf 93ece6f090 Only record swap in teehistorian if active 2022-05-25 19:35:37 +02:00
bors[bot] 1ca4220adf
Merge #5222
5222: Fix crash because of hooks on non ddnet server r=def- a=C0D3D3V

Reported by `@Ясно` Понятно 
on non ddnet server, this code gets run to detect strong-weak ids:
6a5673aa04/src/game/client/gameclient.cpp (L2540-L2541)
which causes a crash because this CCharacterCore is not bound to a gameworld 
the check for m_pWorld failed because m_pWorld is fill of random data
ac15943e85/src/game/gamecore.cpp (L625)
So I would also like to initialize it with a nullpointer 

## 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-05-25 15:51:43 +00:00
c0d3d3v a5cf35576d
init m_pWorld with nullptr 2022-05-25 17:42:44 +02:00
c0d3d3v 6a5673aa04
fix crash on non ddnet server if hook is in view 2022-05-25 17:33:59 +02:00
bors[bot] ac15943e85
Merge #5218
5218: do not snap dragger beam, if the target is out of reach r=def- a=C0D3D3V

fixes #5216

## 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-05-25 15:08:27 +00:00
bors[bot] 00c167148d
Merge #5194
5194: Revert Ellipsis (alternative to #5193) 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-05-25 14:46:16 +00:00
c0d3d3v 82a0354f97
do not dragger beam snap, if the target is out of reach 2022-05-25 16:43:05 +02:00
Dennis Felsing 049a249944 Crash fix (fixes #5217) 2022-05-25 16:28:00 +02:00
Chairn 0076edf499 Remove useless setting 2022-05-25 00:12:38 +02:00
bors[bot] 03f95108b4
Merge #5063
5063: Reworked Draggers and Turrets AND show always hooks if they are in the field of view  r=def- a=C0D3D3V

Fixes #3622, #4723 #4798 and #5054

Here you can find a comparison video with 16.0.3: https://youtu.be/bYwLB1cEMI8

This now also includes the changes from https://github.com/ddnet/ddnet/pull/4980 
So please also see my monologue here: https://github.com/ddnet/ddnet/pull/4980

Physic that got changed by this PR:
- Solo players are not included in the calculation of the next team players to the dragger/turrets. This does not affect any map.
- Turrets get switched correctly if players are solo
- Plasma bullets fired by turrets on solo player only explode for solo players and the other way around (except if they unsolo)
- Plasma bullets can no longer be intercepted by other teams 
- Turrets can shot now independently at the speed of sv_plasma_per_sec for  every team and every solo player


This should be tested by some more players before it get merged!

This reduces the use of snap id's tested here: https://youtu.be/G3nVtdH0--Q 
from 16000 to 69
test with the new dragger: https://youtu.be/mzNrDHP7HQs
I did not add the terminal of the server because you basically see no change in the used snap ids 
The videos are with cl_predict off

Comparison of the new turrets: https://streamable.com/8us8lk
left old turrets, right the new ones

We should delete ranks on (that where made after 13 Jun 2019):
https://ddnet.tw/maps/Increase-32-Your-32-Speed
https://ddnet.tw/maps/Fall-32-into-32-the-32-Future
https://ddnet.tw/maps/turboSeks

## 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
- [only on 3 maps] 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-05-24 18:26:08 +00:00
Robert Müller 0c518baef4 Fix pos1 only scrolling up one page in console 2022-05-23 19:24:56 +02:00
c0d3d3v bf2d3d59ff
do not render freezebar if you are not freezed 2022-05-23 12:12:46 +02:00
def 0c8bf5c3aa Revert "Ellipsis at end in scoreboard and hud"
This reverts commit f278399bd1.
2022-05-22 23:04:32 +02:00
c0d3d3v 60a95c6e4e
mark virtual methods in dragger_beam as overwritten 2022-05-22 22:01:07 +02:00
c0d3d3v 5175734432
Iterate over m_AttachedPlayers instead of MAX_CLIENTS 2022-05-22 21:59:52 +02:00
c0d3d3v f07d773492
Add a set of Players that are attached to a Tee 2022-05-22 21:59:51 +02:00
c0d3d3v 71c9a49776
revert to double explotion plasma bullets if the bullet hits obstacle
and player at the same time
2022-05-22 21:59:51 +02:00
c0d3d3v 9180fa70e4
revert change of dragger range 2022-05-22 21:59:50 +02:00
c0d3d3v 8d644d0638
Snap characters also when a hook is attached to them that is in the field of view 2022-05-22 21:59:49 +02:00
c0d3d3v c251b3d37c
fix server options in comments 2022-05-22 21:59:49 +02:00
c0d3d3v 8fc34ae7b9
Add Comments with Specifications to Turrets and Dragger
- Make Plasma Bullets explode only once if they hit a character and a
  obstacle
- Make turrets fire speed independend from teams and solo players
- Make draggers keep dragging the same tee, also if a closer tee exist
2022-05-22 21:59:48 +02:00
c0d3d3v ab37f95bb4
Do not clip players with hook in the field of view 2022-05-22 21:59:48 +02:00
c0d3d3v d64445d983
Rework Turrets
- Make the code look similar to the code of the draggers
- Make correct switching for solo players, as described here: https://github.com/ddnet/ddnet/pull/4980
- Remove NetworkClipping Bug
- Added intentionally the "Feature" to only explode at one tee
- Make plasma bullets only explode for solo tees if they are solo, not
  for the rest of the team
2022-05-22 21:59:47 +02:00
c0d3d3v 917d12e26c
use TeamMask() instead of Teams()->TeamMask(...) in projectile.cpp and laser.cpp 2022-05-22 21:59:47 +02:00
c0d3d3v 459a845373
use TeamMask() instead of Teams()->TeamMask(...) 2022-05-22 21:59:46 +02:00
c0d3d3v b8cbd8120c
Add ProximityRadius of a tee to the dragger range 2022-05-22 21:59:46 +02:00
c0d3d3v b5166f4048
Simplification of NetworkClippedLine 2022-05-22 21:59:45 +02:00
c0d3d3v 87893ceca7
Move MapScreenToGroup from 3 classes to render.cpp; Rename MapscreenToWorld to MapScreenToWorld 2022-05-22 21:59:43 +02:00
c0d3d3v b751a2e098
Reworked Draggers 2022-05-22 21:59:33 +02:00
bors[bot] 344eeaf8aa
Merge #5192
5192: Add missing nanosecond conversions r=def- a=Jupeyy

fixes #5191

## 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-05-22 18:27:57 +00:00
bors[bot] 85ce4fc0a8
Merge #5185
5185:  Fix pickups moving on their own (fixes #5137) r=C0D3D3V a=def-

Supersedes #5181 

Objects should be initialized fully, otherwise they are super easy to misuse and get weird undefined behavior that happens rarely.

## 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-05-22 14:32:21 +00:00
Jupeyy 2677949e58 Add missing nanosecond conversions 2022-05-22 16:08:11 +02:00
def 3116494f6e Fix some uninitialized variables, found with valgrind 2022-05-22 12:18:49 +02:00
def c4377bb7d9 Always initialize vec2/3/4
Because no tools can detect it uninitialized well, tried Memory
Sanitizer (needs all libs including libc++ compiled with it), valgrind
(only detects in LTO build), compiler warnings. Might be related to
unions.
2022-05-22 12:18:32 +02:00
bors[bot] 1738b0d51b
Merge #5032
5032: Make input handling teehistorian friendly r=def- a=Zwelf

Makes input handling more reproducible during respawn. Still WIP, because I haven't tested this particular patch (only a different one with the same effect).

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
  - [x] swap
  - [x] using timeout protection
  - [x] reconnecting
  - [x] respawning
  - [x] chat keeps movement
  - [x] pause keeps movement
- [x] 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: Zwelf <zwelf@strct.cc>
2022-05-22 09:57:44 +00:00
Zwelf 4a39c846c3 Fix comments 2022-05-22 10:39:18 +02:00
bors[bot] 38c8b5b019
Merge #5182
5182: Fix chat prediction r=def- a=C0D3D3V

reported by nori 
https://cdn.discordapp.com/attachments/293493549758939136/977531792389177364/recording.mp4

I have somehow made the condition wrong xD although I had written correctly in the PR what it should do.

also i noticed that teeworlds does not allow you to hold the hook while chatting, but we have allowed this since 2014....

## 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-05-21 20:50:20 +00:00
Zwelf bc17b29100 Simplify chat check after rearranging player input 2022-05-21 21:40:11 +02:00
Zwelf 44e94ee75a Keep last input on respawn when chatting or pausing 2022-05-21 21:37:17 +02:00
Zwelf 86f57289c6 Record player switch in teehistorian 2022-05-21 21:37:17 +02:00
Zwelf 416af01e0a Sync chat/pause input with weapon and movement input 2022-05-21 21:37:15 +02:00
Zwelf 38c7a921d5 Already use second input 2022-05-21 21:34:30 +02:00
Zwelf b99d8dc259 Always apply last sent input
Makes teehistorian during spawn more reproduceable.
Currently during respawn the first applied input doesn't get recorded.
Always appliying the last sent input fixes this.
2022-05-21 21:34:30 +02:00