mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-29 01:26:53 +01:00
Hold skateboards to their size, and catch one kept on another player
A hacked game was resizing its skateboard and reporting it at another player's position, so everyone saw an oversized board riding on them, and with player collision on it knocked them about. A skateboard is now held to within 10% of its size, apart from the limit on resized body parts: on a dedicated server when its scale limit is on, and in every player's game whatever sent the pose. Another player's board is solid only within 3 m of its own skater; one further off is seen and not felt. Dedicated servers also check for a board kept on another player (Server/board_check.h): one away from its own skater that stays beside one other player while that player travels 8 m over at least 3 seconds. The board is then no longer passed on to the others until it has behaved for half a minute, and the log and the admins in the game are told who. New setting anti_cheat.pinned_board and command board-check: off | warn (default) | kick.
This commit is contained in:
1 parent
b9ffd72409
commit
8044c88373
14 files changed
+289
-13
No files matched your search
@@ -345,12 +345,12 @@ void coarsen(Transform &t, unsigned bits) noexcept {
|
||||
} // namespace
|
||||
void limit_bone_scale(Pose &pose, float limit) noexcept {
|
||||
if (!(limit >= 1.f)) return;
|
||||
const auto hold = [&](Transform &t) {
|
||||
for (float &axis : t.scale) axis = std::isfinite(axis) ? std::clamp(axis, 1.f / limit, limit) : 1.f;
|
||||
const auto hold = [](Transform &t, float most) {
|
||||
for (float &axis : t.scale) axis = std::isfinite(axis) ? std::clamp(axis, 1.f / most, most) : 1.f;
|
||||
};
|
||||
hold(pose.root);
|
||||
for (auto &t : pose.skater) hold(t);
|
||||
for (auto &t : pose.board) hold(t);
|
||||
hold(pose.root, limit);
|
||||
for (auto &t : pose.skater) hold(t, limit);
|
||||
for (auto &t : pose.board) hold(t, std::min(limit, board_scale_limit));
|
||||
}
|
||||
void limit_bone_reach(Pose &pose, float limit) noexcept {
|
||||
if (!(limit > 0.f)) return;
|
||||
|
||||
Reference in new issue
Block a user