MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / Unit_StringToType

Function Unit_StringToType

src/unit.c:337–347  ·  view source on GitHub ↗

* Convert the name of a unit to the type value of that unit, or * UNIT_INVALID if not found. */

Source from the content-addressed store, hash-verified

335 * UNIT_INVALID if not found.
336 */
337uint8 Unit_StringToType(const char *name)
338{
339 uint8 type;
340 if (name == NULL) return UNIT_INVALID;
341
342 for (type = 0; type < UNIT_MAX; type++) {
343 if (strcasecmp(g_table_unitInfo[type].o.name, name) == 0) return type;
344 }
345
346 return UNIT_INVALID;
347}
348
349/**
350 * Convert the name of an action to the type value of that action, or

Callers 4

Scenario_Load_UnitFunction · 0.85
Scenario_Load_ChoamFunction · 0.85
ReadProfileIniFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected