mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 09:21:36 +00:00
CON palfrom: sanity-check current player and maybe print error message.
git-svn-id: https://svn.eduke32.com/eduke32@2615 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
5dd8d20e7a
commit
b2b8ab7890
1 changed files with 12 additions and 4 deletions
|
@ -3316,11 +3316,19 @@ nullquote:
|
||||||
|
|
||||||
case CON_PALFROM:
|
case CON_PALFROM:
|
||||||
insptr++;
|
insptr++;
|
||||||
|
if ((unsigned)vm.g_p >= (unsigned)playerswhenstarted)
|
||||||
{
|
{
|
||||||
int32_t j = 2;
|
OSD_Printf(CON_ERROR "invalid player ID %d\n",g_errorLineNum,keyw[g_tw],vm.g_p);
|
||||||
g_player[vm.g_p].ps->pals.f = *insptr++;
|
insptr += 4;
|
||||||
for (; j>=0; j--)
|
}
|
||||||
*((char *)(&g_player[vm.g_p].ps->pals.r)+2-j) = *insptr++;
|
else
|
||||||
|
{
|
||||||
|
palette_t *const pals = &g_player[vm.g_p].ps->pals;
|
||||||
|
|
||||||
|
pals->f = *insptr++;
|
||||||
|
pals->r = *insptr++;
|
||||||
|
pals->g = *insptr++;
|
||||||
|
pals->b = *insptr++;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue