mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 20:42:11 +00:00
- SW: Replace all pp (.)\= Player \+ (.+)\)
with array accesses.
This commit is contained in:
parent
3c499b060f
commit
2733c90237
6 changed files with 17 additions and 17 deletions
|
@ -271,7 +271,7 @@ void UseInventoryRepairKit(SWPlayer* pp)
|
|||
short inv = INVENTORY_REPAIR_KIT;
|
||||
|
||||
//PlaySound(DIGI_TOOLBOX, pp, v3df_none);
|
||||
if (pp == Player + myconnectindex)
|
||||
if (pp == &Player[myconnectindex])
|
||||
{
|
||||
if (StdRandomRange(1000) > 500)
|
||||
PlayerSound(DIGI_NOREPAIRMAN, v3df_follow|v3df_dontpan,pp);
|
||||
|
@ -349,7 +349,7 @@ void StopInventoryCloak(SWPlayer* pp, short InventoryNum)
|
|||
|
||||
void DoPlayerNightVisionPalette(SWPlayer* pp)
|
||||
{
|
||||
if (pp != Player + screenpeek) return;
|
||||
if (pp != &Player[screenpeek]) return;
|
||||
|
||||
if (pp->InventoryActive[INVENTORY_NIGHT_VISION])
|
||||
{
|
||||
|
|
|
@ -96,7 +96,7 @@ void SetFadeAmt(SWPlayer* pp, short damage, uint8_t startcolor)
|
|||
return;
|
||||
|
||||
// Reset the palette
|
||||
if (pp == Player + screenpeek)
|
||||
if (pp == &Player[screenpeek])
|
||||
{
|
||||
videoFadePalette(0, 0, 0, 0);
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ void SetFadeAmt(SWPlayer* pp, short damage, uint8_t startcolor)
|
|||
auto color = GPalette.BaseColors[pp->StartColor];
|
||||
|
||||
// Do initial palette set
|
||||
if (pp == Player + screenpeek)
|
||||
if (pp == &Player[screenpeek])
|
||||
{
|
||||
videoFadePalette(color.r, color.g, color.b, faderamp[min(31, max(0, 32 - abs(pp->FadeAmt)))]);
|
||||
if (damage < -1000)
|
||||
|
@ -151,7 +151,7 @@ void DoPaletteFlash(SWPlayer* pp)
|
|||
{
|
||||
pp->FadeAmt = 0;
|
||||
pp->StartColor = 0;
|
||||
if (pp == Player + screenpeek)
|
||||
if (pp == &Player[screenpeek])
|
||||
{
|
||||
videoFadePalette(0, 0, 0, 0);
|
||||
DoPlayerDivePalette(pp); // Check Dive again
|
||||
|
@ -186,7 +186,7 @@ void DoPaletteFlash(SWPlayer* pp)
|
|||
{
|
||||
pp->FadeAmt = 0;
|
||||
pp->StartColor = 0;
|
||||
if (pp == Player + screenpeek)
|
||||
if (pp == &Player[screenpeek])
|
||||
{
|
||||
videoFadePalette(0, 0, 0, 0);
|
||||
DoPlayerDivePalette(pp); // Check Dive again
|
||||
|
@ -197,7 +197,7 @@ void DoPaletteFlash(SWPlayer* pp)
|
|||
else
|
||||
{
|
||||
// Only hard set the palette if this is currently the player's view
|
||||
if (pp == Player + screenpeek)
|
||||
if (pp == &Player[screenpeek])
|
||||
{
|
||||
videoFadePalette(
|
||||
GPalette.BaseColors[pp->StartColor].r,
|
||||
|
|
|
@ -321,7 +321,7 @@ void PlayerUpdateHealth(SWPlayer* pp, short value)
|
|||
|
||||
}
|
||||
// Do redness based on damage taken.
|
||||
if (pp == Player + screenpeek)
|
||||
if (pp == &Player[screenpeek])
|
||||
{
|
||||
if (IsChem)
|
||||
SetFadeAmt(pp,-40,144); // ChemBomb green color
|
||||
|
|
|
@ -4101,7 +4101,7 @@ void DoPlayerWarpToSurface(SWPlayer* pp)
|
|||
|
||||
void DoPlayerDivePalette(SWPlayer* pp)
|
||||
{
|
||||
if (pp != Player + screenpeek) return;
|
||||
if (pp != &Player[screenpeek]) return;
|
||||
|
||||
if ((pp->DeathType == PLAYER_DEATH_DROWN || (Player[screenpeek].Flags & PF_DIVING)) && !(pp->Flags & PF_DIVING_IN_LAVA))
|
||||
{
|
||||
|
@ -4138,7 +4138,7 @@ void DoPlayerBeginDive(SWPlayer* pp)
|
|||
DoPlayerDivePalette(pp);
|
||||
DoPlayerNightVisionPalette(pp);
|
||||
|
||||
if (pp == Player + screenpeek)
|
||||
if (pp == &Player[screenpeek])
|
||||
{
|
||||
COVER_SetReverb(140); // Underwater echo
|
||||
pp->Reverb = 140;
|
||||
|
@ -4189,7 +4189,7 @@ void DoPlayerBeginDiveNoWarp(SWPlayer* pp)
|
|||
|
||||
if (pp->Bloody) pp->Bloody = false; // Water washes away the blood
|
||||
|
||||
if (pp == Player + screenpeek)
|
||||
if (pp == &Player[screenpeek])
|
||||
{
|
||||
COVER_SetReverb(140); // Underwater echo
|
||||
pp->Reverb = 140;
|
||||
|
@ -4245,7 +4245,7 @@ void DoPlayerStopDiveNoWarp(SWPlayer* pp)
|
|||
DoPlayerDivePalette(pp);
|
||||
DoPlayerNightVisionPalette(pp);
|
||||
pp->GetActor()->spr.cstat &= ~(CSTAT_SPRITE_YCENTER);
|
||||
if (pp == Player + screenpeek)
|
||||
if (pp == &Player[screenpeek])
|
||||
{
|
||||
COVER_SetReverb(0);
|
||||
pp->Reverb = 0;
|
||||
|
@ -4280,7 +4280,7 @@ void DoPlayerStopDive(SWPlayer* pp)
|
|||
DoPlayerDivePalette(pp);
|
||||
DoPlayerNightVisionPalette(pp);
|
||||
actor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER);
|
||||
if (pp == Player + screenpeek)
|
||||
if (pp == &Player[screenpeek])
|
||||
{
|
||||
COVER_SetReverb(0);
|
||||
pp->Reverb = 0;
|
||||
|
@ -5460,7 +5460,7 @@ void DoPlayerDeathMessage(SWPlayer* pp, SWPlayer* killer)
|
|||
|
||||
killer->KilledPlayer[pp-Player]++;
|
||||
|
||||
if (pp == killer && pp == Player + myconnectindex)
|
||||
if (pp == killer && pp == &Player[myconnectindex])
|
||||
{
|
||||
sprintf(ds,"%s %s",pp->PlayerName,SuicideNote[StdRandomRange(MAX_SUICIDE)]);
|
||||
SEND_OK = true;
|
||||
|
@ -5854,7 +5854,7 @@ void DoPlayerDeathCheckKeys(SWPlayer* pp)
|
|||
|
||||
plActor->user.ID = NINJA_RUN_R0;
|
||||
|
||||
if (pp == Player + screenpeek)
|
||||
if (pp == &Player[screenpeek])
|
||||
{
|
||||
videoFadePalette(0,0,0,0);
|
||||
}
|
||||
|
|
|
@ -1905,7 +1905,7 @@ int DoTrapMatch(short match)
|
|||
|
||||
void TriggerSecret(sectortype* sectp, SWPlayer* pp)
|
||||
{
|
||||
if (pp == Player + myconnectindex)
|
||||
if (pp == &Player[myconnectindex])
|
||||
PlayerSound(DIGI_ANCIENTSECRET, v3df_dontpan | v3df_doppler | v3df_follow, pp);
|
||||
|
||||
SECRET_Trigger(sectindex(pp->cursector));
|
||||
|
|
|
@ -722,7 +722,7 @@ int _PlayerSound(int num, SWPlayer* pp)
|
|||
if (Prediction)
|
||||
return 0;
|
||||
|
||||
if (pp < Player || pp >= Player + MAX_SW_PLAYERS)
|
||||
if (pp < Player || pp >= &Player[MAX_SW_PLAYERS])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue