ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
634 stars 74 forks source link

[TF2] prop_soccer_ball stopping projectiles #4594

Open CopCorvette opened 1 year ago

CopCorvette commented 1 year ago

prop_soccer_ball is making projectiles stop mid air sometimes you can't destroy them unless you have short circuit but still makes the server crash. 20221212175517_1

brokenphilip commented 1 year ago

Currently replicating this and I'm not sure where you're getting crashes from, I assume you're talking about going over the entity limit with these rockets?

Anyways, here's a SourceMod solution in the meantime if it's of interest - it makes rockets pass through the prop (just like other projectiles currently do):

#include <sdkhooks>

#define TFCOLLISION_GROUP_ROCKETS 24

public void OnEntityCreated(int entity, const char[] classname)
{
    if (StrEqual(classname, "prop_soccer_ball"))
        SDKHook(entity, SDKHook_ShouldCollide, CPropSoccerBall__ShouldCollide);
}

public bool CPropSoccerBall__ShouldCollide(int entity, int collisiongroup, int contentsmask, bool originalResult)
{
    if (collisiongroup == TFCOLLISION_GROUP_ROCKETS)
        return false;

    else return originalResult;
}
Borloxos commented 1 year ago

@brokenphilip would that also fix collisions with arrows/bolts or are they a separate collision group? On that note @CopCorvette does the bug apply to all projectiles (basically everything from this page)?

brokenphilip commented 1 year ago

@Borloxos arrows/bolts use the same collision group so this plugin should work for them too, although they were never an issue to begin with when I tested them - the only two problematic projectiles were rockets and flares. (and yes, the plugin works for flares as well)

CopCorvette commented 1 year ago

@Borloxos as far i know it only affects Rockets, Sentry rockets, Arrows and Flares.