Skip to content

[TF2] Fix flame manager lingering when changing class - #1984

Open
zxz41 wants to merge 1 commit into
ValveSoftware:masterfrom
zxz41:lingering-flamemanager-fix
Open

[TF2] Fix flame manager lingering when changing class#1984
zxz41 wants to merge 1 commit into
ValveSoftware:masterfrom
zxz41:lingering-flamemanager-fix

Conversation

@zxz41

@zxz41 zxz41 commented Jul 27, 2026

Copy link
Copy Markdown

Description

There's currently an issue where tf_flame_manager will sit around and take up an edict whenever the player changes class while a flame manager is active.

It would theoretically be possible to crash a server if the edict count is already very low, and since the flame manager will linger around for the duration of a round(?) Any round that takes over ~30 minutes could be crashed by a single person.

The reason why the entity linger around is a bit silly, whenever BaseClass::Update() (AKA CTFPointManager::Update()) gets called every time this entity thinks. There's some server side checks to see if it's time to remove itself.

First the update functions sets bUpdatePoints to true if there are any points in the list.

bool bUpdatePoints = m_vecPoints.Count() > 0;

There might be some case (unsure) where we created the manager, but no points have been created yet.

The manager then proceeds to go through every point in the list if any to see if it should be removed. Otherwise it updates to update it's size bounds if applicable.

It then checks against the bool to see if there were actually points to update, if all the points are removed, it'll remove itself. Otherwise it applies the size to itself.

if ( bUpdatePoints )
{
if ( m_vecPoints.Count() == 0 )
{
UTIL_Remove( this );
}
else
{
Vector vExtent = 0.5f * ( vHullMax - vHullMin );
Vector vOrigin = vHullMin + vExtent;
SetAbsOrigin( vOrigin );
UTIL_SetSize( this, -vExtent, vExtent );
}
}

The issue is that, if it's list gets emptied outside of it's think function, the update function will just assume no points have been created yet.

I might try to do a more proper refactor on some of the point manager stuff, but for now this band aid solution will do rather than having this issue living rent free in the back of my head. It simply just uses UTIL_Remove like most of everything else in the RemoveOwnedProjectiles function. The point manager is already set up to call ClearPoints before being removed.

The only regression caused by this, is that flame particles will be immediately removed, these were only visible client side. As the points for flames would only be removed on the server.

Quick and dirty fix, but it's better than shipping something broken.
@zxz41 zxz41 changed the title Fix flame manager lingering when changing class [TF2] Fix flame manager lingering when changing class Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant