VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::Teleport Class Reference

Report player pawn moves through CBaseEntity::Teleport. More...

#include <Teleport.hpp>

Public Member Functions

 Teleport (EntitySystem &entities, const Bindings &bindings)
 Teleport (const Teleport &)=delete
Teleport & operator= (const Teleport &)=delete
Status Available () const

Public Attributes

Event< int > Before

Detailed Description

Report player pawn moves through CBaseEntity::Teleport.

The hook installs on the first subscription and covers every pawn sharing the CCSPlayerPawn vtable, including respawns. Spawning raises the event as well, so consumers interested only in mid-life teleports must filter spawn events.

The service keeps no teleport history. Consumers decide how long a teleport remains relevant and which clock to use.

_teleports = runtime.Teleport.Before += [this](int slot) { _lastTeleport[slot] = _clock.Time(); };

Definition at line 28 of file Teleport.hpp.

Constructor & Destructor Documentation

◆ Teleport() [1/2]

VoltMod::Teleport::Teleport ( EntitySystem & entities,
const Bindings & bindings )

entities resolves the teleported pawn's slot and bindings supplies the Teleport slot and class vtable. Both must outlive it; the Runtime declares them above.

Definition at line 24 of file Teleport.cpp.

References Before, and VoltMod::HookTeleport().

Referenced by operator=(), and Teleport().

◆ Teleport() [2/2]

VoltMod::Teleport::Teleport ( const Teleport & )
delete

References Teleport().

Member Function Documentation

◆ Available()

Status VoltMod::Teleport::Available ( ) const

Why teleports cannot be tracked: the CBaseEntity::Teleport slot did not bind.

Definition at line 31 of file Teleport.cpp.

References VoltMod::Error::Unsupported().

◆ operator=()

Teleport & VoltMod::Teleport::operator= ( const Teleport & )
delete

References Teleport().

Member Data Documentation

◆ Before

Event<int> VoltMod::Teleport::Before

A player's pawn is about to be teleported.

Definition at line 42 of file Teleport.hpp.

Referenced by Teleport().


The documentation for this class was generated from the following files: