- parse - part 2.

This commit is contained in:
Christoph Oelckers 2020-10-23 20:16:57 +02:00
parent 8bdeb66dcb
commit 65fc6dd3c7

View file

@ -1663,8 +1663,8 @@ int ParseState::parse(void)
insptr++; insptr++;
break; break;
case concmd_motoloopsnd: case concmd_motoloopsnd:
if (!S_CheckSoundPlaying(g_i, 411)) if (!S_CheckActorSoundPlaying(g_ac, 411))
S_PlayActorSound(411, g_i, CHAN_VOICE); S_PlayActorSound(411, g_ac, CHAN_VOICE);
insptr++; insptr++;
break; break;
case concmd_ifgotweaponce: case concmd_ifgotweaponce:
@ -1678,12 +1678,12 @@ int ParseState::parse(void)
if (ps[g_p].weaprecs[j] == g_sp->picnum) if (ps[g_p].weaprecs[j] == g_sp->picnum)
break; break;
parseifelse(j < ps[g_p].weapreccnt&& g_sp->owner == g_i); parseifelse(j < ps[g_p].weapreccnt&& g_ac->GetOwner() == g_ac);
} }
else if (ps[g_p].weapreccnt < 16) else if (ps[g_p].weapreccnt < 16)
{ {
ps[g_p].weaprecs[ps[g_p].weapreccnt++] = g_sp->picnum; ps[g_p].weaprecs[ps[g_p].weapreccnt++] = g_sp->picnum;
parseifelse(g_sp->owner == g_i); parseifelse(g_ac->GetOwner() == g_ac);
} }
} }
else parseifelse(0); else parseifelse(0);
@ -1695,14 +1695,14 @@ int ParseState::parse(void)
else else
{ {
// Copied from DukeGDX. // Copied from DukeGDX.
if (g_sp->picnum == TILE_EGG && hittype[g_i].temp_data[5] == TILE_EGG + 2 && g_sp->pal == 1) if (g_sp->picnum == TILE_EGG && g_ac->temp_data[5] == TILE_EGG + 2 && g_sp->pal == 1)
{ {
ps[connecthead].max_actors_killed++; //revive the egg ps[connecthead].max_actors_killed++; //revive the egg
hittype[g_i].temp_data[5] = 0; g_ac->temp_data[5] = 0;
} }
g_sp->pal = hittype[g_i].tempang; g_sp->pal = g_ac->tempang;
} }
hittype[g_i].tempang = 0; g_ac->tempang = 0;
break; break;
case concmd_tossweapon: case concmd_tossweapon:
insptr++; insptr++;
@ -1713,8 +1713,8 @@ int ParseState::parse(void)
break; break;
case concmd_mikesnd: case concmd_mikesnd:
insptr++; insptr++;
if (!S_CheckSoundPlaying(g_i, g_sp->yvel)) if (!S_CheckActorSoundPlaying(g_ac, g_sp->yvel))
S_PlayActorSound(g_sp->yvel, g_i, CHAN_VOICE); S_PlayActorSound(g_sp->yvel, g_ac, CHAN_VOICE);
break; break;
case concmd_pkick: case concmd_pkick:
insptr++; insptr++;
@ -1740,7 +1740,7 @@ int ParseState::parse(void)
insptr++; insptr++;
if ((g_sp->picnum == TILE_APLAYER && g_sp->yrepeat < 36) || *insptr < g_sp->yrepeat || ((g_sp->yrepeat * (tilesiz[g_sp->picnum].y + 8)) << 2) < (hittype[g_i].floorz - hittype[g_i].ceilingz)) if ((g_sp->picnum == TILE_APLAYER && g_sp->yrepeat < 36) || *insptr < g_sp->yrepeat || ((g_sp->yrepeat * (tilesiz[g_sp->picnum].y + 8)) << 2) < (g_ac->floorz - g_ac->ceilingz))
{ {
j = ((*insptr) - g_sp->yrepeat) << 1; j = ((*insptr) - g_sp->yrepeat) << 1;
if (abs(j)) g_sp->yrepeat += ksgn(j); if (abs(j)) g_sp->yrepeat += ksgn(j);
@ -1758,7 +1758,7 @@ int ParseState::parse(void)
break; break;
case concmd_shoot: case concmd_shoot:
insptr++; insptr++;
fi.shoot(g_i, (short)*insptr); fi.shoot(g_ac->GetIndex(), (short)*insptr);
insptr++; insptr++;
break; break;
case concmd_ifsoundid: case concmd_ifsoundid:
@ -1774,28 +1774,28 @@ int ParseState::parse(void)
break; break;
case concmd_soundtag: case concmd_soundtag:
insptr++; insptr++;
S_PlayActorSound(ambientlotag[g_sp->ang], g_i); S_PlayActorSound(ambientlotag[g_sp->ang], g_ac);
break; break;
case concmd_soundtagonce: case concmd_soundtagonce:
insptr++; insptr++;
if (!S_CheckSoundPlaying(g_i, ambientlotag[g_sp->ang])) if (!S_CheckActorSoundPlaying(g_ac, ambientlotag[g_sp->ang]))
S_PlayActorSound(ambientlotag[g_sp->ang], g_i); S_PlayActorSound(ambientlotag[g_sp->ang], g_ac);
break; break;
case concmd_soundonce: case concmd_soundonce:
insptr++; insptr++;
if (!S_CheckSoundPlaying(g_i, *insptr++)) if (!S_CheckSoundPlaying(*insptr++))
S_PlayActorSound(*(insptr - 1), g_i); S_PlayActorSound(*(insptr - 1), g_ac);
break; break;
case concmd_stopsound: case concmd_stopsound:
insptr++; insptr++;
if (S_CheckSoundPlaying(g_i, *insptr)) if (S_CheckSoundPlaying(*insptr))
S_StopSound((int)*insptr); S_StopSound((int)*insptr);
insptr++; insptr++;
break; break;
case concmd_globalsound: case concmd_globalsound:
insptr++; insptr++;
if (g_p == screenpeek || ud.coop == 1) if (g_p == screenpeek || ud.coop == 1)
S_PlayActorSound((int)*insptr, ps[screenpeek].i); S_PlayActorSound((int)*insptr, ps[screenpeek].GetActor());
insptr++; insptr++;
break; break;
case concmd_smackbubba: case concmd_smackbubba:
@ -1820,7 +1820,7 @@ int ParseState::parse(void)
break; break;
case concmd_sound: case concmd_sound:
insptr++; insptr++;
S_PlayActorSound((short) *insptr,g_i); S_PlayActorSound((short) *insptr,g_ac);
insptr++; insptr++;
break; break;
case concmd_tip: case concmd_tip:
@ -1829,10 +1829,10 @@ int ParseState::parse(void)
break; break;
case concmd_iftipcow: case concmd_iftipcow:
case concmd_ifhittruck: // both have the same code. case concmd_ifhittruck: // both have the same code.
if (hittype[g_i].spriteextra == 1) // if (g_ac->spriteextra == 1) //
{ {
j = 1; j = 1;
hittype[g_i].spriteextra++; g_ac->spriteextra++;
} }
else else
j = 0; j = 0;
@ -1881,7 +1881,7 @@ int ParseState::parse(void)
break; break;
case concmd_sleeptime: case concmd_sleeptime:
insptr++; insptr++;
hittype[g_i].timetosleep = (short)*insptr; g_ac->timetosleep = (short)*insptr;
insptr++; insptr++;
break; break;
case concmd_paper: case concmd_paper: