SourceMod plugin for Neotokyo. Fix dynamic props ignoring disabled collisions.
- SourceMod 1.8 or newer
- Neotokyo include
Important
If using SourceMod older than 1.11: you also need the DHooks extension. Download links are at the bottom of the opening post of the AlliedMods thread. Be sure to choose the correct one for your SM version! You don't need this if you're using SourceMod 1.11 or newer.
For a prop_dynamic you wish to disable collisions for, either set its "Collisions" Keyvalue as "Not Solid", or set the spawnflag "Start with collisions disabled". Also see any exceptions to this rule below.
By default, all dynamic rabbitfrogs will have their solidity disabled regardless of map options, for compatibility with original NT maps.
If you want to disable this, toggle the FROGHACK
preprocessor define in the source code from true
to false
before compiling.
In the Source 2006 engine, any dynamic props using bone followers will incorrectly initialize those bone followers before checking whether the prop should have collisions in the first place:
// CDynamicProp::CreateVPhysics, abridged
if ( pkvBoneFollowers )
{
/* spooky scary bone follower things */
return true;
}
// ...and only later:
if ( GetSolid() == SOLID_NONE || ((GetSolidFlags() & FSOLID_NOT_SOLID) && HasSpawnFlags(SF_DYNAMICPROP_NO_VPHYSICS)))
{
// don't create a physics object in this case - saves CPU & memory
}
This plugin detours the function call, and bails out if trying to initialize bone followers for a non-solid prop.
Most likely this plugin will break the EnableCollision
input for any dynamic props which spawn as non-solid, as they wouldn't have their bone followers initialized in the first place. PRs welcome.