Add methods for clearing netprop cache
As mentioned in PR #1908, changing the behaviour of the datamap cache would break certain extensions. Kenzzer suggested adding functionality for extensions to clear the cache as a fix (though don't ask me how that works).
I never got a response in the discord if this was a good solution or not, but here's a PR to at least keep track of things.
Bumping these ifaces are painful, so while this PR does nothing right now without hacking(?). It seems ok for something that could be exposed later if there's actual pain.
While the PR exposes a clear function, this needs to go further. It'd be really sweet if the gamehelpers interface was updated to expose these new functions to extensions. A proper netprop & datamap clear (which this PR's title doesn't mention, but adds anyways) would be welcomed addition.
There are extensions/plugins out there, mine included, that create custom sendprops and datamaps for entities. Unfortunately if said extensions/plugins are unloaded/reloaded well some custom datamaps might not exist anymore or wrongly cached as non existing, which is definitively going to create a bunch of crash/errors through sourcemod's natives SetEntPropX.
While the PR exposes a clear function, this needs to go further. It'd be really sweet if the gamehelpers interface was updated to expose these new functions to extensions.
Didn't know that was needed, or that g_HL2 wasn't exposed to extensions. Added.
A proper netprop & datamap clear (which this PR's title doesn't mention, but adds anyways) would be welcomed addition.
I thought netprop was the generic term for both, whereas sendprop and datamap/datatable were the specific terms?
Thank you for the changes !
I thought netprop was the generic term for both, whereas sendprop and datamap/datatable were the specific terms?
No sendprop and netprop are synonymous. And datamaps are datamaps (aka dataprops), and datatable is their container. Just like sendtable is the container of sendprops.