mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-24 13:01:36 +00:00
Fix level progress in case all force powers are maxed
This commit is contained in:
parent
b0a45e5907
commit
f819bc8918
1 changed files with 21 additions and 0 deletions
|
@ -4770,6 +4770,27 @@ static void UI_ForcePowerWeaponsButton(qboolean activeFlag)
|
||||||
if(trap_Cvar_VariableValue("helpUsObi") != 0)
|
if(trap_Cvar_VariableValue("helpUsObi") != 0)
|
||||||
activeFlag = qtrue;
|
activeFlag = qtrue;
|
||||||
|
|
||||||
|
if (!activeFlag) {
|
||||||
|
// If all force powers are maxed, let us pass
|
||||||
|
client_t* cl = &svs.clients[0];
|
||||||
|
playerState_t* pState = NULL;
|
||||||
|
int forcelevel;
|
||||||
|
qboolean allforcesmaxed = qtrue;
|
||||||
|
for (int i = 0; i < MAX_POWER_ENUMS; i++) {
|
||||||
|
if (cl) {
|
||||||
|
pState = cl->gentity->client;
|
||||||
|
forcelevel = pState->forcePowerLevel[powerEnums[i].powerEnum];
|
||||||
|
} else {
|
||||||
|
forcelevel = uiInfo.forcePowerLevel[powerEnums[i].powerEnum];
|
||||||
|
}
|
||||||
|
if (forcelevel < 3) {
|
||||||
|
allforcesmaxed = qfalse;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
activeFlag = allforcesmaxed;
|
||||||
|
}
|
||||||
|
|
||||||
// Find weaponsbutton
|
// Find weaponsbutton
|
||||||
itemDef_t *item;
|
itemDef_t *item;
|
||||||
item = (itemDef_s *) Menu_FindItemByName(menu, "weaponbutton");
|
item = (itemDef_s *) Menu_FindItemByName(menu, "weaponbutton");
|
||||||
|
|
Loading…
Reference in a new issue