CModelLoader::GetTypeFromName
0x0019afc0 · 170 bytes · __thiscall
_ZN12CModelLoader15GetTypeFromNameEPKc
Decompiled
undefined (2 params)
/* CModelLoader::GetTypeFromName(char const*) */
byte __thiscall CModelLoader::GetTypeFromName(CModelLoader *this,char *param_1)
{
byte bVar1;
char *pcVar2;
int iVar3;
pcVar2 = (char *)V_GetFileExtension(param_1);
bVar1 = 0;
if (pcVar2 != (char *)0x0) {
iVar3 = _V_stricmp(pcVar2,"spr");
if ((((iVar3 != 0) && (iVar3 = _V_stricmp(pcVar2,"vmt"), iVar3 != 0)) &&
(iVar3 = _V_stricmp(pcVar2,"avi"), iVar3 != 0)) &&
(iVar3 = _V_stricmp(pcVar2,"bik"), iVar3 != 0)) {
iVar3 = _V_stricmp(pcVar2,"bsp");
if (iVar3 == 0) {
return 1;
}
iVar3 = _V_stricmp(pcVar2,"mdl");
return -(iVar3 == 0) & 3;
}
bVar1 = 2;
}
return bVar1;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.