MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / Osiris_FindLoadedModule

Function Osiris_FindLoadedModule

Descent3/OsirisLoadandBind.cpp:771–788  ·  view source on GitHub ↗

Osiris_FindLoadedModule Purpose: Given the name of a module, it returns the id of a loaded OSIRIS module. -1 if it isn't loaded.

Source from the content-addressed store, hash-verified

769// Purpose:
770// Given the name of a module, it returns the id of a loaded OSIRIS module. -1 if it isn't loaded.
771int Osiris_FindLoadedModule(char *module_name) {
772 // search through the list of loaded modules and see if we can find a match
773 // strip off the extension
774 char real_name[_MAX_PATH];
775 ddio_SplitPath(module_name, NULL, real_name, NULL);
776
777 int i;
778 for (i = 0; i < MAX_LOADED_MODULES; i++) {
779 if (OSIRIS_loaded_modules[i].flags & OSIMF_INUSE) {
780 if (OSIRIS_loaded_modules[i].module_name && (!stricmp(OSIRIS_loaded_modules[i].module_name, real_name))) {
781 // we found a match
782 return i;
783 }
784 }
785 }
786
787 return -1;
788}
789
790// Osiris_UnloadModule
791// Purpose:

Callers 3

Osiris_LoadLevelModuleFunction · 0.85
Osiris_LoadGameModuleFunction · 0.85

Calls 1

ddio_SplitPathFunction · 0.50

Tested by

no test coverage detected