- player.i, part 1

This commit is contained in:
Christoph Oelckers 2020-11-02 20:23:05 +01:00
parent d5a74e4290
commit 770897b8b9
7 changed files with 16 additions and 16 deletions

View file

@ -539,14 +539,14 @@ void operatejaildoors(int hitag)
jaildooropen[i] = 1; jaildooropen[i] = 1;
jaildoordrag[i] = jaildoordist[i]; jaildoordrag[i] = jaildoordist[i];
if (!isRRRA() || jaildoorsound[i] != 0) if (!isRRRA() || jaildoorsound[i] != 0)
S_PlayActorSound(jaildoorsound[i], ps[screenpeek].i); S_PlayActorSound(jaildoorsound[i], ps[screenpeek].GetActor());
} }
if (jaildooropen[i] == 2) if (jaildooropen[i] == 2)
{ {
jaildooropen[i] = 3; jaildooropen[i] = 3;
jaildoordrag[i] = jaildoordist[i]; jaildoordrag[i] = jaildoordist[i];
if (!isRRRA() || jaildoorsound[i] != 0) if (!isRRRA() || jaildoorsound[i] != 0)
S_PlayActorSound(jaildoorsound[i], ps[screenpeek].i); S_PlayActorSound(jaildoorsound[i], ps[screenpeek].GetActor());
} }
} }
} }

View file

@ -197,13 +197,13 @@ void addweapon_r(struct player_struct* p, int weapon)
case THROWINGDYNAMITE_WEAPON: case THROWINGDYNAMITE_WEAPON:
break; break;
case SHOTGUN_WEAPON: case SHOTGUN_WEAPON:
S_PlayActorSound(SHOTGUN_COCK, p->i); S_PlayActorSound(SHOTGUN_COCK, p->GetActor());
break; break;
case PISTOL_WEAPON: case PISTOL_WEAPON:
S_PlayActorSound(INSERT_CLIP, p->i); S_PlayActorSound(INSERT_CLIP, p->GetActor());
break; break;
default: default:
S_PlayActorSound(EJECT_CLIP, p->i); S_PlayActorSound(EJECT_CLIP, p->GetActor());
break; break;
} }
} }

View file

@ -1956,7 +1956,7 @@ int ParseState::parse(void)
{ {
if ((j - *insptr) < (max_player_health >> 2) && if ((j - *insptr) < (max_player_health >> 2) &&
j >= (max_player_health >> 2)) j >= (max_player_health >> 2))
S_PlayActorSound(DUKE_GOTHEALTHATLOW, ps[g_p].i); S_PlayActorSound(DUKE_GOTHEALTHATLOW, ps[g_p].GetActor());
ps[g_p].last_extra = j; ps[g_p].last_extra = j;
} }
@ -2032,7 +2032,7 @@ int ParseState::parse(void)
{ {
if ((j - *insptr) < (max_player_health >> 2) && if ((j - *insptr) < (max_player_health >> 2) &&
j >= (max_player_health >> 2)) j >= (max_player_health >> 2))
S_PlayActorSound(229, ps[g_p].i); S_PlayActorSound(229, ps[g_p].GetActor());
ps[g_p].last_extra = j; ps[g_p].last_extra = j;
} }
@ -2097,7 +2097,7 @@ int ParseState::parse(void)
{ {
if( ( j - *insptr ) < (max_player_health>>2) && if( ( j - *insptr ) < (max_player_health>>2) &&
j >= (max_player_health>>2) ) j >= (max_player_health>>2) )
S_PlayActorSound(isRR()? 229 : DUKE_GOTHEALTHATLOW,ps[g_p].i); S_PlayActorSound(isRR()? 229 : DUKE_GOTHEALTHATLOW,ps[g_p].GetActor());
ps[g_p].last_extra = j; ps[g_p].last_extra = j;
} }
@ -2230,7 +2230,7 @@ int ParseState::parse(void)
g_sp->y = g_ac->bposy = ps[g_p].bobposy = ps[g_p].oposy = ps[g_p].posy; g_sp->y = g_ac->bposy = ps[g_p].bobposy = ps[g_p].oposy = ps[g_p].posy;
g_sp->z = g_ac->bposy = ps[g_p].oposz = ps[g_p].posz; g_sp->z = g_ac->bposy = ps[g_p].oposz = ps[g_p].posz;
updatesector(ps[g_p].posx, ps[g_p].posy, &ps[g_p].cursectnum); updatesector(ps[g_p].posx, ps[g_p].posy, &ps[g_p].cursectnum);
setsprite(ps[g_p].i, ps[g_p].posx, ps[g_p].posy, ps[g_p].posz + PHEIGHT); setsprite(ps[g_p].GetActor(), ps[g_p].posx, ps[g_p].posy, ps[g_p].posz + PHEIGHT);
g_sp->cstat = 257; g_sp->cstat = 257;
g_sp->shade = -12; g_sp->shade = -12;

View file

@ -77,7 +77,7 @@ inline int checkcursectnums(int se)
{ {
int i; int i;
for(i=connecthead;i>=0;i=connectpoint2[i]) for(i=connecthead;i>=0;i=connectpoint2[i])
if((unsigned)ps[i].i < MAXSPRITES && ps[i].GetActor()->s.sectnum == se ) return i; if(ps[i].GetActor() && ps[i].GetActor()->s.sectnum == se ) return i;
return -1; return -1;
} }

View file

@ -950,7 +950,7 @@ void enterlevel(MapRecord *mi, int gamemode)
for (int i = connecthead; i >= 0; i = connectpoint2[i]) for (int i = connecthead; i >= 0; i = connectpoint2[i])
{ {
int pn = sector[sprite[ps[i].i].sectnum].floorpicnum; int pn = sector[ps[i].GetActor()->s.sectnum].floorpicnum;
if (pn == TILE_HURTRAIL || pn == TILE_FLOORSLIME || pn == TILE_FLOORPLASMA) if (pn == TILE_HURTRAIL || pn == TILE_FLOORSLIME || pn == TILE_FLOORPLASMA)
{ {
resetweapons(i); resetweapons(i);

View file

@ -279,11 +279,12 @@ void animatecamsprite(double smoothratio)
int spriteNum = camsprite; int spriteNum = camsprite;
auto p = &ps[screenpeek]; auto p = &ps[screenpeek];
auto sp = &sprite[spriteNum]; auto act = &hittype[spriteNum];
auto sp = &act->s;
if (p->newowner >= 0) sp->owner = p->newowner; if (p->newowner >= 0) sp->owner = p->newowner;
if (sp->owner >= 0 && dist(&sprite[p->i], sp) < VIEWSCREEN_ACTIVE_DISTANCE) if (sp->owner >= 0 && dist(p->GetActor(), act) < VIEWSCREEN_ACTIVE_DISTANCE)
{ {
auto tex = tileGetTexture(sp->picnum); auto tex = tileGetTexture(sp->picnum);
TileFiles.MakeCanvas(TILE_VIEWSCR, tex->GetDisplayWidth(), tex->GetDisplayHeight()); TileFiles.MakeCanvas(TILE_VIEWSCR, tex->GetDisplayWidth(), tex->GetDisplayHeight());
@ -621,8 +622,8 @@ void displayrooms(int snum, double smoothratio)
// do screen rotation. // do screen rotation.
renderSetRollAngle(rotscrnang.asbam() / (double)(BAMUNIT)); renderSetRollAngle(rotscrnang.asbam() / (double)(BAMUNIT));
cz = hittype[p->i].ceilingz; cz = p->GetActor()->ceilingz;
fz = hittype[p->i].floorz; fz = p->GetActor()->floorz;
if (earthquaketime > 0 && p->on_ground == 1) if (earthquaketime > 0 && p->on_ground == 1)
{ {

View file

@ -444,7 +444,6 @@ int S_PlaySound3D(int sndnum, int spriteNum, const vec3_t* pos, int channel, ECh
if (ud.multimode == 1) if (ud.multimode == 1)
{ {
spriteNum = pl->i; spriteNum = pl->i;
auto sp = &sprite[spriteNum];
} }
} }