|
VoltMod
C++23 framework for CS2 server plugins
|
Holds one pawn still and gives its move type back to that pawn only, so a player who respawns while held never inherits the dead body's. Keep one per player. More...
#include <MovementFreeze.hpp>
Public Member Functions | |
| void | Hold (const Pawn &pawn) |
| void | Release (const Pawn &pawn) |
| void | Sync (const Pawn &pawn) |
| operator bool () const noexcept | |
Holds one pawn still and gives its move type back to that pawn only, so a player who respawns while held never inherits the dead body's. Keep one per player.
Definition at line 13 of file MovementFreeze.hpp.
| void VoltMod::MovementFreeze::Hold | ( | const Pawn & | pawn | ) |
Freeze pawn. Does nothing when a pawn is already held, or when pawn cannot be.
Definition at line 6 of file MovementFreeze.cpp.
References VoltMod::Pawn::IsAlive(), VoltMod::Entity::MoveType(), VoltMod::Schema::MOVETYPE_NONE, VoltMod::Entity::Ref(), and VoltMod::Entity::SetMoveType().
Referenced by Sync().
|
inlineexplicitnoexcept |
Whether a pawn is being held.
Definition at line 27 of file MovementFreeze.hpp.
| void VoltMod::MovementFreeze::Release | ( | const Pawn & | pawn | ) |
Give pawn its move type back if it is the one being held, then forget it.
Definition at line 19 of file MovementFreeze.cpp.
References VoltMod::Entity::Ref(), and VoltMod::Entity::SetMoveType().
| void VoltMod::MovementFreeze::Sync | ( | const Pawn & | pawn | ) |
Carry the hold across a respawn: forget a replaced pawn without writing to it, then hold pawn.
Definition at line 33 of file MovementFreeze.cpp.
References Hold(), VoltMod::Pawn::IsAlive(), and VoltMod::Entity::Ref().