L L4D2node

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 into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)