69 Commits

Author SHA1 Message Date
yvt
6e262ea6ec
Add stmp::make_unique
This template function is a polyfill of `std::make_unique`, which is
unavailable in GCC 4.9 (should we even be supporting this old thing?).
2019-07-20 16:17:10 +09:00
yvt
7c3a39e639
Modernize
- Replaced raw pointers with references or smart pointers. Nullable
  references are represented by `stmp::optional<const T&>`. (There are
  many raw pointers still remaining. They should be replaced at some
  point.)
- Added class template specializations `stmp::optional<T &>` and
  `stmp::optional<const T&>`.
- Fixed `stmp::optional`'s various behaviors
- `World::{players, playerPersistents}` are now `std::array`.
- More uses of `stmp::optional` to clarify the semantics
- Renamed `PlayerThrownGrenade` to `PlayerThrewGrenade`
- Replaced old-style `for` loops with range based ones
- Deleted `Player`'s default constructors and `operator =`
- Deleted `TCGameMode`'s default constructor and `operator =`
- Deleted `CTFGameMode`'s default constructor and `operator =`
- Replaced `static_cast` with `dynamic_cast` for down-casting
- `RefCountedObject::operator*()` no longer requires non-constness to
  return `T &`.
- Replaced the uses of `std::vector::operator[]` with `std::vector::at`
  for bounds checking.
- Made some methods of `GameMap` `const`.
- Added some null checks.
2019-07-17 00:31:00 +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
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
yvt
7d0d8e3704 Create Weapon instances based on the current GameProperties, not a cvar 2017-09-11 20:59:39 +09:00
yvt
03b5d7869e Fix recoil motion 2017-03-04 03:36:10 +09:00
yvt
1743c2c764 Update recoil/spread amount to match measured values 2017-02-25 23:08:36 +09:00
yvt
2b230c0598 Fix #254 2017-02-20 04:00:08 +09:00
yvt
cf1404c8ae Regenerate block’s health after a certain period of time
Fixes #148
2017-02-20 03:30:10 +09:00
yvt
971432a373 Recoil adjustment 2017-02-20 03:11:54 +09:00
yvt
84e1292526 Fix blood sprite spawning location 2017-02-18 20:00:39 +09:00
yvt
38529b73c6 Fix #551
Thanks @kmsiapps for pointing this out!
2017-02-11 03:46:31 +09:00
yvt
2554eaad57 Refactor, add more checks 2017-01-05 04:11:42 +09:00
yvt
ada91e2c5a Fix an issue which caused a hit to be not registered 2016-12-18 00:57:46 +09:00
yvt
2046afd660 Fix #487 2016-12-17 22:19:54 +09:00
Tomoaki Kawada
624d291f79 Update #includes
- Reorder them so that system libraries come first
- Use C++-style headers (`<cmath>`) instead of C-style headers (`<math.h>`)
2016-12-03 19:04:58 +09:00
Tomoaki Kawada
ebd79c0099 Change #include style
All `#include`s to other subsystem now use angle brackets, e.g., `#include <Core/Math.h>`.
2016-12-03 18:49:07 +09:00
Tomoaki Kawada
2eb9e35c65 Apply clang-format to all non-external source files 2016-12-03 18:23:47 +09:00
Tomoaki Kawada
4d964d6595 Add more camera shake (cg_shake 2) and additional movements of view weapons 2016-11-22 01:25:22 +09:00
Tomoaki Kawada
18f3e81fd1 Convert space indentations to tabs 2016-11-20 19:13:00 +09:00
Tomoaki Kawada
1e32f6d72a Fix #337 2016-11-11 22:32:03 +09:00
Tomoaki Kawada
866267daad More recoils
Improves the AoS 0.75 compatibility.
2016-11-06 23:09:16 +09:00
Chameleonhider
39a7c74fa6 Pressing sprint doesn't stop anymore from using tool / weapon
Pressing sprint key used to prevent using tool/weapon. Now sprint key
must be pressed together with movement keys (while not crouching) to
prevent you from using tool/weapon.
2016-02-11 10:43:55 +02:00
yvt
6b1eff6726 git add map weapon icons 2015-06-20 17:14:05 +09:00
tuukka
9a7f94348e Movement slowdown when looking up and down changed to match beta better 2014-04-23 12:25:24 +03:00
yvt
593b302611 Reduce “cannot build” error 2014-04-07 19:47:24 +09:00
yvt
6e401f669a Fix #76 2014-04-07 00:48:04 +09:00
yvt
d856bcadaa Reduce compiler warnings 2014-04-06 22:42:17 +09:00
yvt
bfcf96ad13 Fix #73 2014-03-30 01:42:18 +09:00
yvt
145211d07f Cancel build when player dies (Fixed #189) 2014-03-13 01:19:29 +09:00
yvt
e89220664a Line build is cancelled when the starting point was destroyed (fixed #135) 2014-03-13 01:15:12 +09:00
yvt
7561f16952 Improved usability of block tool 2014-03-13 01:07:22 +09:00
yvt
64c48d2123 Bullet impact effect for hitting surface level blocks 2014-03-13 00:54:08 +09:00
yvt
b3491e1a2b Water bullet impact 2014-03-12 03:38:45 +09:00
yvt
cf8d4f3cb0 Alerts 2014-03-11 03:42:04 +09:00
yvt
2599d14900 Refactor 2014-03-09 21:43:38 +09:00
yvt
be4a9952ce Added hit detection debugger 2014-03-09 01:03:38 +09:00
yvt
06a29cb7ab Work-around for bug that placing block occasionally becomes impossible (the actual cause of this problem is still unknown) 2014-02-04 00:39:52 +09:00
learn_more
bac067c1c7 Merge branch 'master' of https://github.com/yvt/openspades 2013-12-04 00:46:53 +01:00
yvt
cc0e20aa7a Correct weapon spread distribution (triangular distribution instead of uniform one) 2013-12-02 16:16:29 +09:00
learn_more
7bc571f819 size_t instead of int (cannot have negative number of players :)
cleanup some formatting (more readable)
2013-11-22 23:09:16 +01:00
learn_more
d41b91631f fix a shitton of warnings 2013-09-20 23:03:32 +02:00
yvt
378d29b3d9 Place blocks by holding LMB 2013-09-06 12:42:11 +09:00
yvt
30dbb862c6 Added copyright header of pysnip 2013-09-05 00:52:03 +09:00
yvt
ccd71bbfb0 Velocity is updated when NetClient receives WorldUpdate 2013-09-03 01:24:03 +09:00
yvt
7a9d9fdfc0 When a server didn't return WeaponReload packet, sets weapon's ammo count by client 2013-09-03 00:28:39 +09:00
yvt
c13ebe66fc Work-around for reload-related protocol issue 2013-09-02 17:36:08 +09:00
yvt
e657a4c55f Fixed reload related bug 2013-09-02 16:46:50 +09:00
yvt
c0be1e9038 Fixed a bug that shotgun sometimes ceases to fire 2013-09-02 15:15:40 +09:00