mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-27 01:10:51 +00:00
CON: Fix checkavailweapon command.
git-svn-id: https://svn.eduke32.com/eduke32@6408 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
fe10e46778
commit
bb13b0db85
1 changed files with 7 additions and 6 deletions
|
@ -4280,22 +4280,23 @@ finish_qsprintf:
|
||||||
|
|
||||||
case CON_CHECKAVAILWEAPON:
|
case CON_CHECKAVAILWEAPON:
|
||||||
case CON_CHECKAVAILINVEN:
|
case CON_CHECKAVAILINVEN:
|
||||||
insptr++;
|
|
||||||
tw = (*insptr != g_thisActorVarID) ? Gv_GetVarX(*insptr) : vm.playerNum;
|
|
||||||
insptr++;
|
|
||||||
|
|
||||||
if (EDUKE32_PREDICT_FALSE((unsigned)tw >= (unsigned)g_mostConcurrentPlayers))
|
|
||||||
{
|
{
|
||||||
CON_ERRPRINTF("invalid player %d\n", tw);
|
insptr++;
|
||||||
|
size_t const playerNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(*insptr) : vm.playerNum;
|
||||||
|
|
||||||
|
if (EDUKE32_PREDICT_FALSE((unsigned)playerNum >= (unsigned)g_mostConcurrentPlayers))
|
||||||
|
{
|
||||||
|
CON_ERRPRINTF("invalid player %d\n", (int)playerNum);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tw == CON_CHECKAVAILWEAPON)
|
if (tw == CON_CHECKAVAILWEAPON)
|
||||||
P_CheckWeapon(g_player[tw].ps);
|
P_CheckWeapon(g_player[playerNum].ps);
|
||||||
else
|
else
|
||||||
P_SelectNextInvItem(g_player[tw].ps);
|
P_SelectNextInvItem(g_player[playerNum].ps);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
case CON_GETPLAYERANGLE:
|
case CON_GETPLAYERANGLE:
|
||||||
insptr++;
|
insptr++;
|
||||||
|
|
Loading…
Reference in a new issue