Commit graph

158 commits

Author SHA1 Message Date
Robert Müller 4949645663 Organize game-shared includes 2022-06-17 17:39:25 +02:00
effyn 6691d71da7 Gender-neutral language 2022-06-16 15:12:25 -07:00
ChillerDragon 3667061b68 Use nullptr in generated and editor
-Wzero-as-null-pointer-constant
2022-06-13 18:28:13 +02:00
Chairn 01edaec628 Format vector variables names (fixes #5209) 2022-06-11 21:38:49 +02:00
c0d3d3v 24e1fa9a73
change m_ZeroEnergyBounceInLastTick to bool 2022-06-10 17:46:32 +02:00
c0d3d3v c579e2637f
let lasers bounce with zero energy for one tick 2022-06-10 15:16:41 +02:00
trml 882ddae201 Send switch timing info in extended switch state netobject 2022-06-02 01:04:34 +02:00
trml 548de3804e Rename NumSwitchers to HighestSwitchNumber and remove most references 2022-06-02 00:57:11 +02:00
trml 66c0c1e692 Send timer info for switchers and predict switch state changes 2022-06-02 00:57:09 +02:00
trml 95c4c2db1c Move switch state to gamecore 2022-06-02 00:51:25 +02:00
Robert Müller 7474ca201f Remove dead code 2022-05-31 19:32:07 +02:00
c0d3d3v 5065bab8b5
fix swap does not swap no collision and no hook
- remove duplicated variable for no collision and no hook
2022-05-30 19:33:42 +02:00
Robert Müller 91d2ba1865 Organize game-client includes 2022-05-29 21:24:43 +02:00
Robert Müller c2f92c1e13 Organize game-shared includes 2022-05-29 20:02:22 +02:00
Alexander Akulich a39bbc702b Introduce and use constexpr CCharacterCore::PhysicalSize 2022-05-28 21:46:44 +03:00
Alexander Akulich deb2e8752f Sync prediction impl with server CCharacter::IsGrounded() 2022-05-28 21:46:07 +03:00
Alexander Akulich a023671ecd prediction/entity: Sync constructor signature, add GetProximityRadius() 2022-05-28 21:28:47 +03:00
bors[bot] ab28267e30
Merge #5265
5265: Cleanup prediction entity handling a little r=def- a=trml

I looked over the remaining code for creating/removing entities in the prediction, and only ended up making some smaller changes:
- More consistent use of InsertEntity/RemoveEntity/Destroy
- Fixed one instance in gameclient.cpp where an entity was removed but not deleted (could potentially have been a memory leak)
- Removed some old code for retaining information about the characters after they left the snapshot (the client should only rely on the snapshot for prediction of players)

## 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: trml <trml@users.noreply.github.com>
2022-05-28 12:48:10 +00:00
trml c5595209fe Fix and slightly cleanup creation/destruction/insertion of predicted entities 2022-05-28 13:37:59 +02:00
c0d3d3v 04f1bbf59f
reintroduce shotgun bug 2022-05-28 00:58:33 +02:00
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
Dennis Felsing 68bcd21eff asan+ubsan clean 2022-05-26 01:22:14 +02:00
c0d3d3v f07d773492
Add a set of Players that are attached to a Tee 2022-05-22 21:59:51 +02: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
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
Zwelf 38c7a921d5 Already use second input 2022-05-21 21:34:30 +02:00
c0d3d3v 71669e3427
release hook in mods that do not allow inputs while chatting 2022-05-21 18:52:14 +02:00
c0d3d3v 2cb47583b8
fix condition of BugDDRaceInput, do only reset innputs on non ddnet mods 2022-05-21 18:17:10 +02:00
c0d3d3v 9c97995679
Fix Spezial Jumps for players with 0, 1 and -1 Jumps
- Add some more documentation to the code
- reverted early ground jump to keep physics
2022-05-20 21:37:05 +02:00
c0d3d3v f5ff227561
fix inputs on vanilla server if chat is open 2022-05-19 23:18:14 +02:00
Chairn 583d6e6c01 Mark virtual function as override using a script:
while IFS= read -r line; do file=${line%%:*}; lineno=$(echo $line | cut
-d':' -f2); echo "Treating $file line $lineno"; sed -i -e
"${lineno}s/virtual //" -e "${lineno}s/);\$/) override;/" -e
"${lineno}s/)\$/) override/" -e "${lineno}s/const\$/const override/" -e
"${lineno}s/) {/) override {/" -e "${lineno}s/) const {/) const override
{/" -e "${lineno}s/const;$/const override;/" "$file"; done < a
2022-05-17 23:47:32 +02:00
c0d3d3v d6833b6fd6
fix jump display 2022-05-16 23:17:19 +02:00
c0d3d3v fa2ac1bb64
Merge branch 'master' into New_HUD
* master: (87 commits)
  Remove base/tl/string.h
  Replace remaining usage of base/tl/string with std::string
  Remove unused includes of base/tl/string.h
  Store localized strings in a CHeap instead of using tl/string.h
  Mark methods as const
  Add CHeap::StoreString method
  Rules are chat responses too
  Add margins to demo slice popup, decrease error font size, UI scaling
  Remove redundant parameters which are overridden later
  Use Margin instead of both VMargin and HMargin
  Move variable declaration
  Only output messages intended for chat to the user of a chat command
  Remove unused chat response variables
  Don't print the first "Waiting for score threads to complete"
  fix usage of undefined behavior for default eyes
  remove duplicate HOOK_RETRACTED assignment
  do not send swap request notification to complete team 0
  make swap messages more personal
  Move ninja shield to other position (fixes #5047)
  do not release the hooks if you swap
  ...
2022-05-10 19:03:09 +02:00
c0d3d3v a289503411
remove duplicate HOOK_RETRACTED assignment 2022-04-30 21:41:13 +02:00
Dennis Felsing 298287fb4e Implement shields that remove specific weapon (fixes #4572)
Thanks to Cellegen for graphics.

Functionality works, still a bit buggy sprite display, maybe someone can
quickly spot what I'm doing wrong
2022-04-28 16:49:32 +02:00
bors[bot] 6cce22d056
Merge #4813 #4905
4813: Don't allow infinite shotgun bounce (fixes #4809) r=heinrich5991 a=def-

I hope this kind of physic isn't used anywhere, I couldn't trigger it without being stuck in wall.

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


4905: Fix move_sqlite (fixes #4902) r=heinrich5991 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: def <dennis@felsin9.de>
2022-04-28 12:11:05 +00:00
Edgar 646162eb09
make super ignore livefreeze, fix #4973 2022-04-18 15:40:39 +02:00
c0d3d3v a9c8b344a2
Player position, speed and angle can now be displayed in the HUD.
- Added RenderMovementInformation() to the HUD
- Use m_Width instead of recalculating the display width each time in hud.cpp
- Reworked Debug HUD:
    - Display velspeed.x*ramp and velspeed.y instead of velspeed*ramp
    - Show unit of speed
    - The graph for the velspeed.x*ramp behavior (if dbg_tuning is active) is now nicer and usable. A second graph zooming in on the turning point has been added.
    - The velspeed.x*ramp graph will be redrawn only when new tuning parameters are added
- The target angle used to draw the tees is now calculated using the m_TargetX, m_TargetY in DDNetCharacterDisplayInfo if available.
- Added m_TargetX, m_TargetY and m_RampValue to DDNetCharacterDisplayInfo Snap (m_RampValue has a precision of one thousandth)
- Added CGraph::InsertAt() to create static Graphs
- Added "assets/hud" to initial created Directories
- Added Settings to hide Dummy Action HUD and Player Movement HUD cl_showhud_dummy_actions, cl_showhud_player_position, cl_showhud_player_speed, cl_showhud_player_angle
- Added Pointer to m_PrevExtendedDisplayInfo, for calculation of interpolated Angle in Player Rendering
- Added GetDigitsIndex(int Value, float Max); to hud.cpp
2022-04-14 13:42:19 +02:00
c0d3d3v 670da66ec1
add vertical ninja bar 2022-04-14 13:40:44 +02:00
c0d3d3v a4b6558ff6
load CNetObj_DDNetCharacterDisplayInfo into CCharacter 2022-04-14 13:40:44 +02:00
c0d3d3v e71578e468
Add DDNetCharacterDisplayInfo NetObj
- Show all components of new HUD also in Spectator (Ninja Bar, Freeze
  Bar and Jumps)
- hide freeze bar if you sit in freeze
2022-04-14 13:40:40 +02:00
c0d3d3v b403f474a0
Add Freeze Bar 2022-04-14 13:40:05 +02:00
c0d3d3v 3957a7404e
move m_Ninja in Character Core 2022-04-14 13:38:55 +02:00
c0d3d3v 320e9e030f
Rename Read() function to avoid equal naming 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
Chairn 21e64cbdcb Added external linkage instead of static const 2022-04-03 01:12:27 +02:00
Chairn d4aac67929 Fixed some useless double promotion 2022-03-23 18:22:08 +01:00