ddnet/src/game
bors[bot] 5d927f35b6
Merge #3502
3502: Some (mostly backported) refactor r=Learath2 a=Kaffeine

Port some cleanup and refactoring from the upstream and add some custom refactoring.

Changes overview:
- Backported angle() and direction() functions (upstream commit 7735557aa5)
- Backported vector math cleanup (remove some pointless templates, refactor other functions; upstream commit bdaabc10bc)
- `ddracechat.h` (used by both client and server) moved to a shared dir next to `ddracecommands.h`
- Backport `IGameController::DoActivityCheck()`
- Backport `IGameController::DoTeamChange()`
- Backport `IGameController::OnPlayerDisconnect()`
- Refactor Emote-related code (decouple the code and hide the details in CPlayer class)
- Fix: restore default emote on the emote override ended over.
- CCharacter::HandleTiles(): Move a part of DDRace-specific code to the DDRace GameController
- Add `IGameController::GetMaskForPlayerWorldEvent()` to port classes away from direct `CGameControllerDDRace/CGameTeams` usage.

Result overview:
- CPlayer does not depend on CGameControllerDDRace nor CGameTeams anymore
- CCharacter does not depend on CGameControllerDDRace anymore

I'm not sure that `GetMaskForPlayerWorldEvent()` is a good name for that. The idea of the method is to abstract the users of `CreateExplosion`, `CreatePlayerSpawn`, `CreateDeath`, `CreateSound`, and other world events from thinking about the player team.

I checked that the client and server work (didn't do deep testing though).

## Checklist

- [x] Tested the change ingame
- Provided screenshots if it is a visual change (no visual changes)
- Tested in combination with possibly related configuration options (no related options)
- [ ] Written a unit test if it works standalone, system.c especially
- [x] 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: Alexander Akulich <akulichalexander@gmail.com>
Co-authored-by: BeaR <cinaera@web.de>
2021-01-21 10:56:38 +00:00
..
client Merge #3502 2021-01-21 10:56:38 +00:00
editor Merge #3463 2021-01-10 15:46:11 +00:00
server Merge #3502 2021-01-21 10:56:38 +00:00
bezier.cpp Run clang-format 2020-09-26 21:50:15 +02:00
bezier.h Run clang-format 2020-09-26 21:50:15 +02:00
collision.cpp Fix float loops 2020-10-23 15:12:59 +02:00
collision.h Run clang-format 2020-09-26 21:50:15 +02:00
ddracechat.h ddracechat.h is used by the client, so move it to src/game 2021-01-16 03:20:57 +03:00
ddracecommands.h Add (un)endless_hook command 2020-12-26 23:09:38 +01:00
extrainfo.cpp Run clang-format 2020-09-26 21:50:15 +02:00
extrainfo.h Manual preparation for cleaner clang-format 2020-09-26 21:41:01 +02:00
gamecore.cpp DDRace GameController: Set Teams to CCharacter on Spawned 2021-01-19 22:36:22 +03:00
gamecore.h DDRace GameController: Set Teams to CCharacter on Spawned 2021-01-19 22:36:22 +03:00
layers.cpp Run clang-format 2020-09-26 21:50:15 +02:00
layers.h Run clang-format 2020-09-26 21:50:15 +02:00
localization.cpp Run clang-format 2020-09-26 21:50:15 +02:00
localization.h Run clang-format 2020-09-26 21:50:15 +02:00
mapbugs.cpp Fix variable names manually 2020-11-02 22:40:40 +01:00
mapbugs.h Remove code for CRC in most places, except where needed for net compat 2020-10-14 17:08:58 +02:00
mapbugs_list.h Revert "Add mapbug "stoppers-passthrough@ddnet.tw"" 2018-08-22 08:33:21 +02:00
mapitems.cpp clang-format: fix style 2020-09-14 16:00:51 +02:00
mapitems.h Use std::sort instead of bubble_sort 2020-10-08 08:00:01 +02:00
mapitems_ex.cpp Run clang-format 2020-09-26 21:50:15 +02:00
mapitems_ex.h Run clang-format 2020-09-26 21:50:15 +02:00
mapitems_ex_types.h Run clang-format 2020-09-26 21:50:15 +02:00
prng.cpp Run clang-format 2020-09-26 21:50:15 +02:00
prng.h Use check_header_guards script 2020-09-11 00:03:31 +02:00
teamscore.cpp Run clang-format 2020-09-26 21:50:15 +02:00
teamscore.h Fix out of bounds access in GetSolo 2020-10-18 16:52:29 +02:00
tuning.h Run clang-format 2020-09-26 21:50:15 +02:00
variables.h Remove hardcoded zoom level 2020-12-20 18:32:16 +01:00
version.h Version 15.2.5 2020-12-29 14:30:00 +01:00
voting.h Run clang-format 2020-09-26 21:50:15 +02:00