484 Commits

Author SHA1 Message Date
NotAFile
49a4c0dd4f remove duplicate handling of VersionGet 2019-05-04 20:21:44 +02:00
NotAFile
2ecd3ced44 detect end of map transfer with state packet
Previously, the end of map transfer was detected by a number of fallible
heuristics, including checking if the map is loadable on every non-map
packet, when a timeout had been reached, or the map size given by the
server was reached. This broke in a number of scenarios, including when
an unexpected packet was sent.

Instead, we now detect the end of the map transfer when we receive a
state packet, as intended by the protocol.
2019-05-04 20:14:42 +02:00
yvt
203528a769 Add a hotkey to expand the chat log
Closes #744.
2019-01-01 14:47:40 +09:00
yvt
c7fb662f77 Remove dead code 2018-12-31 21:35:37 +09:00
yvt
2fddc13024 Eliminate compiler warnings
- Possible misuse of comma operators
- `std::move` prevents copy elision
2018-12-31 21:34:30 +09:00
Jipok
d25cf1bb91
Show shotgun tracers 2018-12-09 21:09:28 +05:00
yvt
cfb972f944 Improve code quality
- Overriding methods are clearly indicated with `override` keywords
- Remove redundant `virtual` keywords from destructors of subclasses
- Introduce `SPUnsupported()`, replacing most uses of
  `SPNotImplemented()`, which now serves as a dynamic "TODO" marker
2018-10-13 14:43:49 +09:00
yvt
30e49b68aa Implement thread-local random number generator 2018-09-18 22:18:54 +09:00
yvt
585cbfce1c Improve random number generation
The global RNG state is now protected from simultaneous accesses by
employing a mutex.

Performance sensitive code requiring generation of a large number of
random numbers can utilize `LocalRNG`. This is not thread-safe but
provides a much greater throughput. `LocalRNG` is seeded by the global
RNG only at construction time.
2018-09-17 23:48:38 +09:00
Davi
358800f260 Flashlight fixes: dead players and spectators may no longer toggle the flashlight, spectating other players while dead will keep your flashlight off 2018-07-15 16:07:34 -03:00
Benjamin
1bd5cd7cc5 make palette hotkeys configurable (closes #752) 2018-07-04 09:22:19 -07:00
YVT
399e24090d
Merge pull request #654 from NotAFile/scoreboard-show-dead-players
Show Dead players in gray on scoreboard
2018-02-21 16:18:50 +09:00
Godwhoa
474f5cbf69 Fix input for ThirdPersonLocal
Closes: #717
2018-02-19 23:48:53 +05:30
NotAFile
4ea1e50ae0 Add Counter for world updates per Second (#707)
* Add Counter for world updates per Second

This work was just done for personal testing and is probably not up to the
required code standards. Nonetheless, I have decided to send a PR as it is very
useful information and a good starting point.

* add MarkWorldUpdate method
2018-01-06 19:38:14 +09:00
yvt
03cfbdee12 Fix the wrong reference to a config variable 2017-12-31 18:35:12 +09:00
yvt
35bcea5110 Indicate that you carry the intel
Fixes #601.
2017-12-30 23:47:47 +09:00
yvt
f702eca1d8 Fix crash on server connection 2017-12-30 04:28:50 +09:00
yvt
28cd9a3c87 clang-format 2017-12-29 20:49:10 +09:00
yvt
4cb5c578c5 Eliminate compiler warning 2017-12-29 20:47:20 +09:00
yvt
3086f03cf9 Accept handshake packets anytime
Fixes #644.
2017-12-29 20:46:35 +09:00
yvt
77dfedb533 Fix #678 for real 2017-12-29 20:35:32 +09:00
yvt
336d476e8d Attempt to enable follow cam when no one's there no longer leaves you in an invalid state 2017-12-29 20:34:31 +09:00
yvt
a8dbe92423 Rename a config variable to follow the naming convention 2017-12-29 20:17:43 +09:00
yvt
2f5a21be1e Prevent a dead player from being first-person spectated
Fixes #679.
2017-12-29 20:15:23 +09:00
yvt
4bd819adcd Fix spectator display and keyboard input
- Fixes #681 (Pressing space while in free-camera mode does not move up).
- Fixes #678 (Have seconday fire cycle through the player list backwards
  in sepctator mode).
- "Stop following a player" is bound to "R" (reload) by default.
- Add help messages displayed on the screen.
2017-12-29 20:06:49 +09:00
yvt
38ad676a29 Fix to compile on a debug build 2017-12-29 19:29:26 +09:00
yvt
842d34c92f Display more HUD elements in the first-person spectate mode
Fixes #682.
2017-12-29 19:21:44 +09:00
yvt
ff2b6587a1 Display MapView in the free floating camera spectating mode
Fixes #682 partially.
2017-12-29 19:06:45 +09:00
yvt
9f464d718d Fix #690 2017-12-22 22:38:34 +09:00
yvt
d7768ae0d5 Fix "invalid player ID" error after map change
Fixes #66. Wow, it's been 4 years since the issue was reported for the
first time.

*Inhale* yay!
2017-12-16 23:38:54 +09:00
yvt
49cc61c573 Use more smart pointers and modern language constructs 2017-12-15 23:05:08 +09:00
yvt
660066fc2f Rewrite the camera control logic
- Fixes #664
- Fixes #520
2017-12-05 15:42:24 +09:00
YVT
fdcb77789e
Merge pull request #675 from Rootmars/fix-first-person-zoom
First-person spectate now zooms with the player
2017-12-05 13:03:20 +09:00
yvt
8c38843485 Do not display block placement cursor when unable to place blocks
Fixes #660.
2017-12-05 12:46:34 +09:00
md
bdcfbbec27 First-person spectate now zooms with player 2017-11-29 20:11:10 -08:00
md
67af71d1ff Alert player when building above highest z-level.
Made it so that an alert is displayed when the player attempts
to build beyond the highest z-level (e.g. above the platform
in babel.)

This also fixes a bug where blocks are consumed when attempting
to do such thing.
2017-11-27 19:50:05 -02:00
David Carlier
4864f07937 Reducing some compilation warnings. 2017-11-18 21:15:07 +00:00
YVT
e93ea55e3f Adjust the gain of hit feedback sound (#659)
Fixes #652.

The sound gain is now constant and does not change regardless of the
distance. This imitates the behavior often seen in other first-person
shooters.

Switching from "Play" to "PlayLocal" only affects the way the gain is
computed since "HeadshotFeedback.opus" is a stereo sound file and there-
fore not spatialized by any known audio backends.

This also introduces a config variable named "cg_hitFeedbackSoundGain"
that allows users to adjust the volume of the hit feedback sound.
2017-09-17 14:15:20 +09:00
NotAFile
266d141e04 First person enhancements (#656)
* only switch first-person mode while spectating

closes #655

* use first person view for first-person spectating

* don't spectate specators; refactor
2017-09-17 14:15:06 +09:00
yvt
7d0d8e3704 Create Weapon instances based on the current GameProperties, not a cvar 2017-09-11 20:59:39 +09:00
yvt
821c392ade Add protocol version parameter to GameProperties’ constructor 2017-09-11 20:49:21 +09:00
notafile
79689848dd Show Dead players in gray on scoreboard
This is done for all cases, but that is probably a bad idea. While this
does not matter in public games, in small tournaments this could be an
advantage. Ideally, the server could disable giving players this
information
2017-09-07 20:32:24 +02:00
NotAFile
bfe62a0a2c Skip dead players when spectating between spawns (#653)
* Skip dead players when spectating between spawns

This makes e.g. spectating the last player alive in arena easier

* Add skip dead players config option
2017-09-08 01:39:22 +09:00
Teodor
0cb053c15d Add a headshot bang sound like in classic (#648)
* Add satisfying headshot bangs like in classic

* add whack sound

* Update Client_Update.cpp

* Add files via upload

* Moved to Resources/Sounds/Feedback

* Play only if inflicted by LocalPlayer

Also lowered volume

* Update AUTHORS

* Update Credits.inc
2017-09-05 18:27:05 +09:00
yvt
f016bd7cee Prepare for an increased number of player slots
Related: #630
2017-09-04 14:39:37 +09:00
notafile
1578bdf157 add ability to push messages to CenterMessageView 2017-09-04 00:36:22 +02:00
yvt
a8ae6c1098 Clear the kill count when a player leaves
Fixes #620.
2017-09-03 16:59:33 +09:00
yvt
a853a58631 Remove corpses after respawn on a certain game mode
Fixes #145.
2017-09-03 16:56:01 +09:00
yvt
aa22e4b25a Show "player joined team" message for the Spectator team
Fixes #635.
2017-09-03 16:00:30 +09:00
yvt
ca892698e3 Minor fixes
- Remove unnecessary `volatile`
- Replace some operations with atomic ones for soundness
- Clean up
- Avoid certain UBs
- Typo
2017-06-25 21:15:27 +09:00