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

Function UI_CountForcePowers

code/ui/ui_main.cpp:4647–4671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4645
4646#ifndef JK2_MODE
4647static int UI_CountForcePowers( void ) {
4648 const client_t *cl = &svs.clients[0];
4649
4650 if ( cl && cl->gentity ) {
4651 const playerState_t *ps = cl->gentity->client;
4652 return ps->forcePowerLevel[FP_HEAL] +
4653 ps->forcePowerLevel[FP_TELEPATHY] +
4654 ps->forcePowerLevel[FP_PROTECT] +
4655 ps->forcePowerLevel[FP_ABSORB] +
4656 ps->forcePowerLevel[FP_GRIP] +
4657 ps->forcePowerLevel[FP_LIGHTNING] +
4658 ps->forcePowerLevel[FP_RAGE] +
4659 ps->forcePowerLevel[FP_DRAIN];
4660 }
4661 else {
4662 return uiInfo.forcePowerLevel[FP_HEAL] +
4663 uiInfo.forcePowerLevel[FP_TELEPATHY] +
4664 uiInfo.forcePowerLevel[FP_PROTECT] +
4665 uiInfo.forcePowerLevel[FP_ABSORB] +
4666 uiInfo.forcePowerLevel[FP_GRIP] +
4667 uiInfo.forcePowerLevel[FP_LIGHTNING] +
4668 uiInfo.forcePowerLevel[FP_RAGE] +
4669 uiInfo.forcePowerLevel[FP_DRAIN];
4670 }
4671}
4672#endif
4673
4674//. Find weapons button and make active/inactive (Used by Force Power Allocation screen)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected