VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
MovementFreeze.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace VoltMod
7{
8
9/**
10 * @brief Holds one pawn still and gives its move type back to that pawn only, so a player who
11 * respawns while held never inherits the dead body's. Keep one per player.
12 */
14{
15public:
16 /** Freeze @p pawn. Does nothing when a pawn is already held, or when @p pawn cannot be. */
17 void Hold(const Pawn& pawn);
18
19 /** Give @p pawn its move type back if it is the one being held, then forget it. */
20 void Release(const Pawn& pawn);
21
22 /** Carry the hold across a respawn: forget a replaced pawn without writing to it, then hold
23 * @p pawn. */
24 void Sync(const Pawn& pawn);
25
26 /** Whether a pawn is being held. */
27 explicit operator bool() const noexcept { return static_cast<bool>(_pawn); }
28
29private:
30 EntityRef _pawn;
32};
33
34} // namespace VoltMod
Holds one pawn still and gives its move type back to that pawn only, so a player who respawns while h...
void Sync(const Pawn &pawn)
void Hold(const Pawn &pawn)
void Release(const Pawn &pawn)
A player's body: health, armor, movement, aim, weapons. The engine replaces it on every spawn; the Co...
Definition Pawn.hpp:19
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56