MCPcopy Create free account
hub / github.com/JACoders/OpenJK / UI_GetForcePowerIndex

Function UI_GetForcePowerIndex

code/ui/ui_main.cpp:4519–4536  ·  view source on GitHub ↗

Find the index to the Force Power in powerEnum array

Source from the content-addressed store, hash-verified

4517
4518// Find the index to the Force Power in powerEnum array
4519static qboolean UI_GetForcePowerIndex ( const char *forceName, short *forcePowerI )
4520{
4521 int i;
4522
4523 // Find a match for the forceName passed in
4524 for (i=0;i<MAX_POWER_ENUMS;i++)
4525 {
4526 if ( !Q_stricmp(forceName, powerEnums[i].title ) )
4527 {
4528 *forcePowerI = i;
4529 return(qtrue);
4530 }
4531 }
4532
4533 *forcePowerI = FP_UPDATED_NONE; // Didn't find it
4534
4535 return(qfalse);
4536}
4537
4538// Set the fields for the allocation of force powers (Used by Force Power Allocation screen)
4539static void UI_InitAllocForcePowers ( const char *forceName )

Callers 3

UI_InitAllocForcePowersFunction · 0.85
UI_AffectForcePowerLevelFunction · 0.85
UI_ShowForceLevelDescFunction · 0.85

Calls 1

Q_stricmpFunction · 0.85

Tested by

no test coverage detected