606 Commits

Author SHA1 Message Date
Thor Hanson
8b18025a9c Add variation in SMG ejecting brass velocity
Without this commit, the SMG's ejecting brass tends to fall unnaturally:
If the gun hasn't moved, each casing falls in the exact same trajectory
and in the exact same location.

This commit adds a small amount of random variation to each casing's
veloctiy, which looks more natural.
2022-01-09 13:55:29 -06:00
yvt
f532e85e18
Merge pull request #989 from yvt/fix-uncrouching
Fix getting stuck when uncrouching
2021-12-15 22:05:43 +09:00
yvt
c0414e9906 feat(client): remove the finite-difference velocity estimation
This velocity estimation routine has been present since the beginning of
time, but it seems that this actually does more harm than good.

Neither the vanilla client nor BetterSpades implements velocity
estimation.
2021-12-15 21:54:38 +09:00
yvt
5fa2173465
Merge pull request #960 from yvt/feat-your-tracer
Implement first-person bullet tracers
2021-12-09 21:16:52 +09:00
yvt
d31dc21048 fix(client): handle all cases correctly when uncrouching
When a player releases the "crouch" key, `Player::TryUncrouch` is
responsible for checking if uncrouching is possible and adjusting the
local player position accordingly so that the legs won't be embedded in
a ground thereafter. There are two cases in which uncrouching succeeds.
Case 1: The player is airborne, and there's room under the legs. Case 2:
There's room over the head.

The old code did not rely on `Player::TryUncrouch` for player position
readjustment. Instead, `Player::SetInput` was actually responsible for
this. Unfortunately, it did not distinguish the cases correctly. It did
check correctly whether uncrouching is possible. However, to determine
which of Case 1 and Case 2 is applicable, it only checked the player's
airborne-ness, therefore it incorrectly selected Case 1 if the player is
airborne but there's no room under the legs. This incorrect
implementation resulted in annoying bugs where a player gets stuck in a
ground if the player uncrouches just above it.
2021-12-08 20:19:46 +09:00
Rakete175
7cf405cf40 NetClient.cpp: Actually send Enhanced version packet
Currently OpenSpades doesnt send the extended version info which contains
some useful info to the server even when being told that it wants it.

This commit adds sending of the packet so servers will receive such info when
they ask for it.
2021-11-14 23:11:06 +01:00
yvt
a9333424ba
Merge pull request #964 from Haxk20/patch-1
Disable recoil if not local player
2021-08-14 14:44:18 +09:00
yvt
ee1f8a4772 fix(client): relax the lower bound of the denominator used in numerical differentiation for velocity estimation
Improves the smoothness of non-local player movement in a server that
sends ten WorldUpdate packages for each second (i.e., 10 updates per
second).

I wouldn't dare to relax the bound further since this technique is
extremely susceptible to jitter. The server sending WorldUpdate packets
with `PACKET_FLAG_UNSEQUENCED` isn't exactly helping since that
introduces discontinuity into the received position stream, and the
denominator lower bound is the only thing that keeps the estimation from
exploding. (The packets should really be unreliable + sequenced.)
2021-08-11 23:43:36 +09:00
yvt
4f5c2427d8 fix(client): std::deque::deque(size_t n) sets the length to n, not the capacity
Fixes #918.
2021-07-22 17:48:30 +09:00
Haxk20
b15894bd64 Player.cpp: Disable recoil if not local player
This commit completely disables any sign of recoil if
the packet is coming from a player that is not local
player.

We want to apply recoil to local player weapon
but we do not want to apply it to others as
we just want to display what was given to us
(Their client already adds recoil. If not they
are cheating)
2021-07-11 01:23:01 +02:00
yvt
f9da7da1b0 feat(client): make tracers less conspicuous 2021-06-20 16:15:18 +09:00
yvt
536c8687b1 feat(client): scale tracers in proportion to their distances to the camera 2021-06-20 16:15:18 +09:00
yvt
ce1c7cfc19 feat(client): display bullet tracers fired by the local player 2021-06-20 16:15:18 +09:00
yvt
c51f1453cc feat(client): spawn bullet tracers at the current weapon skin's muzzle position 2021-06-20 16:15:17 +09:00
yvt
c1b5781752 feat(client): support specifying the muzzle and case ejection positions in the weapon skins 2021-06-20 16:15:17 +09:00
yvt
3b5d7ecf33 feat(client): randomize the starting position of a bullet tracer 2021-06-20 16:15:16 +09:00
yvt
70feb0870b feat(client): revamp the flashlight 2021-06-20 16:13:02 +09:00
yvt
3bda029e34 feat(client): remove the lens flare effect of the flashlight
It had caused severe banding when HDR is enabled.
2021-06-20 16:13:02 +09:00
yvt
14de74ac1f perf(client): use the VP-screen matrix to calculate the result of Client::Project 2021-06-20 16:11:47 +09:00
yvt
9a758f27f7 refactor(client): add SceneDefinition::{ToOpenGLProjectionMatrix, ToViewMatrix} 2021-06-20 16:11:45 +09:00
yvt
8ac141daf4 feat(draw): support linear lights 2021-06-20 16:11:39 +09:00
Pablo-Dallegri
b6e0153e62 Rename new cvar 2021-05-07 11:52:16 -03:00
Pablo-Dallegri
4fd3329c1d Revert cg_alerts renaming 2021-05-07 11:46:14 -03:00
Pablo-Dallegri
3349ac54ab Add alerts volume slider 2021-05-07 11:00:17 -03:00
Pablo-Dallegri
b9001dfb55 Rename cg_alerts to cg_alerts_show 2021-05-07 10:29:49 -03:00
Pablo-Dallegri
bb751ebebb Use unit inteval 2021-05-05 07:32:23 -03:00
Pablo Dallegri
e59acb67ab Change chat beep from toggle to slider 2021-05-05 04:12:08 -03:00
yvt
b1022213f3 Merge branch 'master' into patch-modernize 2021-05-02 23:39:03 +09:00
yvt
c073c92c6a fix(client): don't pass nullptr to std::nan, don't use std::nan at all
`std::nan` converts a given string to a quiet NaN value in an
implementation-defined way. It accepts an empty string, but that doesn't
mean you can pass `nullptr`. Passing `nullptr` causes a segmentation
fault on Linux but does not on macOS, which I think is why I missed that
in the first place.

Actually, `std::nan` isn't even really needed here, hence I replaced it
with `NAN`.
2021-01-05 16:22:17 +09:00
yvt
4aef2bbef8 Play hit sounds only once per attack
Fixes #925.
2020-12-17 00:59:09 +09:00
yvt
cb5f0d9284
fix: remove any remaining references to cg_smp
Fixes #923.
2020-12-17 00:39:23 +09:00
Tomoaki Kawada
738c7e509e
Merge pull request #848 from Tuupertunut/master
Fixed map loading with protocol 0.76.
2020-08-06 15:21:09 +09:00
Tomoaki Kawada
5a57a5e406
Explain why we send MapCached 2020-08-06 15:19:16 +09:00
yvt
4fbe5ee5ce
Reset intels and team scores after receiving winning IntelCapture
This problem was originally reported in:
<https://github.com/piqueserver/piqueserver/issues/586>

Upon receiving `IntelCapture` with `winning = 1`, the voxlap client
resets both team scores and the holding status of both teams' intels,
but OpenSpades didn't do that, resulting in a weird behavior described
in piqueserver/piqueserver#586. This commit changes OpenSpades' behavior
to be congruent with the voxlap client's behavior.

Fixes #890.
2020-04-20 13:38:57 +09:00
hourai-dev
a0aa55b24a
Removed unnecessary call to GetHorizontalLength(). 2020-04-16 12:46:13 -05:00
yvt
ada518be9d
Merge branch 'gunplayfix' of https://github.com/BR-/openspades into BR--gunplayfix 2019-12-09 00:25:36 +09:00
dtomlinson-ga
4ce8546df8 Fix typo in Player::GetVelocity()
Corrected GetVelocty() to GetVelocity() everywhere it occurs.
2019-11-28 22:10:38 +09:00
Anthony Som
08e792e7fa Fix aim-down-sight sound when ammo count is zero (#858)
* Fix aim-down-sight sound when ammo count is zero

Fixes #858.

* Delete settings.json
2019-10-08 08:51:47 +09:00
Tuupertunut
3539b4240c Fixed map loading with protocol 0.76. 2019-09-22 21:16:05 +03:00
yvt
e4e72d7dca
ParticleSpriteEntity: Replace Client * with Client & 2019-08-08 01:22:01 +09:00
yvt
8d9145c6ec
SmokeSpriteEntity: Replace Client * with Client & 2019-08-08 01:20:26 +09:00
yvt
eece4c3251
TCGameMode: Force bounds check 2019-08-08 01:11:59 +09:00
yvt
99489cab66
TCProgressView: Replace Client * with Client & 2019-08-08 01:10:28 +09:00
yvt
1a4594d9bd
Tracer: Replace Client * with Client & 2019-08-08 01:09:22 +09:00
yvt
066eda82df
Add bounds check 2019-08-08 01:08:12 +09:00
yvt
ef2d844a97
clang-format all source files under Sources/Client 2019-08-07 23:51:05 +09:00
yvt
b49028d822 Add const to GameMapLoader::IsComplete 2019-07-24 19:11:36 +09:00
yvt
3b15a205ff Replace Deque with std::deque
Profiling indicated that a little time (< 10% of `ApplyBlockActions`'s
total execution time) is spent on `Deque` when a large chunk of block
is being removed. Thus even *if* this commit slows down things, the
performance impact would be insignificant.
2019-07-24 19:11:36 +09:00
yvt
d1ba2a729b
Fix to build with GCC 4.9
> error: invalid use of incomplete type ‘class spades::Bitmap’
2019-07-23 22:55:02 +09:00
yvt
f841c94db7
Change the return type of CreatePipeStream to use unique_ptr 2019-07-23 22:28:56 +09:00