mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-20 18:52:43 +00:00
- the final u()'s.
This commit is contained in:
parent
cf88bcbecb
commit
26f93ab724
4 changed files with 31 additions and 46 deletions
|
@ -5456,15 +5456,14 @@ void DoPlayerBeginDie(PLAYERp pp)
|
|||
if (numplayers > 1)
|
||||
{
|
||||
// Give kill credit to player if necessary
|
||||
if (pp->KillerActor != nullptr)
|
||||
DSWActor* killer = pp->KillerActor;
|
||||
if (killer != nullptr)
|
||||
{
|
||||
USERp ku = pp->KillerActor->u();
|
||||
ASSERT(killer->hasU());
|
||||
|
||||
ASSERT(ku);
|
||||
|
||||
if (ku && ku->PlayerP)
|
||||
if (killer->hasU() && killer->user.PlayerP)
|
||||
{
|
||||
if (pp == ku->PlayerP)
|
||||
if (pp == killer->user.PlayerP)
|
||||
{
|
||||
// Killed yourself
|
||||
PlayerUpdateKills(pp, -1);
|
||||
|
@ -5476,24 +5475,24 @@ void DoPlayerBeginDie(PLAYERp pp)
|
|||
if (gNet.TeamPlay)
|
||||
{
|
||||
// playing team play
|
||||
if (pp->Actor()->user.spal == ku->spal)
|
||||
if (pp->Actor()->user.spal == killer->user.spal)
|
||||
{
|
||||
// Killed your team member
|
||||
PlayerUpdateKills(pp, -1);
|
||||
DoPlayerDeathMessage(pp, ku->PlayerP);
|
||||
DoPlayerDeathMessage(pp, killer->user.PlayerP);
|
||||
}
|
||||
else
|
||||
{
|
||||
// killed another team member
|
||||
PlayerUpdateKills(ku->PlayerP, 1);
|
||||
DoPlayerDeathMessage(pp, ku->PlayerP);
|
||||
PlayerUpdateKills(killer->user.PlayerP, 1);
|
||||
DoPlayerDeathMessage(pp, killer->user.PlayerP);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// not playing team play
|
||||
PlayerUpdateKills(ku->PlayerP, 1);
|
||||
DoPlayerDeathMessage(pp, ku->PlayerP);
|
||||
PlayerUpdateKills(killer->user.PlayerP, 1);
|
||||
DoPlayerDeathMessage(pp, killer->user.PlayerP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,8 +125,6 @@ void SpawnVis(DSWActor* parentActor, sectortype* sect, int x, int y, int z, int
|
|||
DSWActor* actorNew = nullptr;
|
||||
if (parentActor != nullptr)
|
||||
{
|
||||
auto pu = parentActor->u();
|
||||
|
||||
if (parentActor->spr.sector()->floorpal == PALETTE_FOG)
|
||||
return;
|
||||
|
||||
|
@ -148,13 +146,11 @@ void SpawnVis(DSWActor* parentActor, sectortype* sect, int x, int y, int z, int
|
|||
|
||||
|
||||
ASSERT(parentActor->hasU());
|
||||
SET(pu->Flags2, SPR2_CHILDREN);
|
||||
SET(parentActor->user.Flags2, SPR2_CHILDREN);
|
||||
|
||||
actorNew->spr.pos.X = parentActor->spr.pos.X;
|
||||
actorNew->spr.pos.Y = parentActor->spr.pos.Y;
|
||||
actorNew->spr.pos.Z = parentActor->spr.pos.Z;
|
||||
actorNew->spr.pos = parentActor->spr.pos;
|
||||
|
||||
SET(pu->Flags2, SPR2_VIS_SHADING);
|
||||
SET(parentActor->user.Flags2, SPR2_VIS_SHADING);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -48,7 +48,6 @@ void SOwallmove(SECTOR_OBJECTp sop, DSWActor* actor, WALLp find_wallp, int dist,
|
|||
if (!actor->hasU() || TEST(sop->flags, SOBJ_SPRITE_OBJ))
|
||||
return;
|
||||
|
||||
auto u = actor->u();
|
||||
wallcount = 0;
|
||||
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
|
||||
{
|
||||
|
@ -59,9 +58,8 @@ void SOwallmove(SECTOR_OBJECTp sop, DSWActor* actor, WALLp find_wallp, int dist,
|
|||
// find the one wall we want to adjust
|
||||
if (&wal == find_wallp)
|
||||
{
|
||||
short ang;
|
||||
// move orig x and y in saved angle
|
||||
ang = u->sang;
|
||||
int ang = actor->user.sang;
|
||||
|
||||
*nx = MulScale(dist, bcos(ang), 14);
|
||||
*ny = MulScale(dist, bsin(ang), 14);
|
||||
|
|
|
@ -2820,7 +2820,6 @@ int DoLavaErupt(DSWActor* actor)
|
|||
|
||||
int SpawnShrap(DSWActor* parentActor, DSWActor* secondaryActor, int means, BREAK_INFOp breakinfo)
|
||||
{
|
||||
USERp pu = parentActor->u();
|
||||
short i;
|
||||
|
||||
/////////////////////////////////////////
|
||||
|
@ -3190,16 +3189,16 @@ int SpawnShrap(DSWActor* parentActor, DSWActor* secondaryActor, int means, BREAK
|
|||
}
|
||||
}
|
||||
|
||||
ASSERT(pu);
|
||||
ASSERT(parentActor->hasU());
|
||||
|
||||
switch (pu->ID)
|
||||
switch (parentActor->user.ID)
|
||||
{
|
||||
case ST1:
|
||||
switch (parentActor->spr.hitag)
|
||||
{
|
||||
case SPAWN_SPOT:
|
||||
{
|
||||
if (pu->LastDamage)
|
||||
if (parentActor->user.LastDamage)
|
||||
shrap_type = SP_TAG3(parentActor);
|
||||
else
|
||||
shrap_type = SP_TAG6(parentActor);
|
||||
|
@ -3508,7 +3507,7 @@ AutoShrap:
|
|||
case FIREBALL_EXP:
|
||||
return false;
|
||||
// p = FireballExpShrap[RANDOM_P2(2<<8)>>8];
|
||||
// shrap_pal = pu->spal;
|
||||
// shrap_pal = parentActor->user.spal;
|
||||
break;
|
||||
case ELECTRO_PLAYER:
|
||||
case ELECTRO_ENEMY:
|
||||
|
@ -3528,7 +3527,7 @@ AutoShrap:
|
|||
{
|
||||
extern STATEp sg_PlayerHeadHurl[];
|
||||
|
||||
if (pu->Rot == sg_PlayerHeadHurl)
|
||||
if (parentActor->user.Rot == sg_PlayerHeadHurl)
|
||||
{
|
||||
p = PlayerHeadHurl1;
|
||||
}
|
||||
|
@ -3546,9 +3545,9 @@ AutoShrap:
|
|||
case NINJA_RUN_R0:
|
||||
{
|
||||
p = StdShrap;
|
||||
if (pu->PlayerP)
|
||||
if (parentActor->user.PlayerP)
|
||||
{
|
||||
PLAYERp pp = pu->PlayerP;
|
||||
PLAYERp pp = parentActor->user.PlayerP;
|
||||
|
||||
if (pp->DeathType == PLAYER_DEATH_CRUMBLE)
|
||||
p = PlayerGoreFall;
|
||||
|
@ -3566,14 +3565,14 @@ AutoShrap:
|
|||
break;
|
||||
case RIPPER_RUN_R0:
|
||||
p = StdShrap;
|
||||
if (pu->spal != 0)
|
||||
if (parentActor->user.spal != 0)
|
||||
shrap_xsize = shrap_ysize = 64;
|
||||
else
|
||||
shrap_xsize = shrap_ysize = 32;
|
||||
break;
|
||||
case RIPPER2_RUN_R0:
|
||||
p = StdShrap;
|
||||
if (pu->spal != 0)
|
||||
if (parentActor->user.spal != 0)
|
||||
shrap_xsize = shrap_ysize = 64;
|
||||
else
|
||||
shrap_xsize = shrap_ysize = 32;
|
||||
|
@ -6913,9 +6912,8 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor)
|
|||
const char *DeathString(DSWActor* actor)
|
||||
{
|
||||
if (!actor->hasU()) return " ";
|
||||
USERp ku = actor->u();
|
||||
|
||||
switch (ku->ID)
|
||||
switch (actor->user.ID)
|
||||
{
|
||||
case NINJA_RUN_R0:
|
||||
return " ";
|
||||
|
@ -7376,7 +7374,6 @@ int DoMineExpMine(DSWActor* actor)
|
|||
|
||||
int DoStar(DSWActor* actor)
|
||||
{
|
||||
USERp su;
|
||||
int vel;
|
||||
|
||||
const int STAR_STICK_RNUM = 400;
|
||||
|
@ -7570,8 +7567,8 @@ int DoStar(DSWActor* actor)
|
|||
{
|
||||
if (actor->user.coll.type == kHitSprite && actor->user.coll.actor()->hasU())
|
||||
{
|
||||
su = actor->user.coll.actor()->u();
|
||||
if (su->ID == TRASHCAN || su->ID == ZILLA_RUN_R0)
|
||||
auto su = actor->user.coll.actor();
|
||||
if (su->user.ID == TRASHCAN || su->user.ID == ZILLA_RUN_R0)
|
||||
PlaySound(DIGI_STARCLINK, actor, v3df_none);
|
||||
}
|
||||
|
||||
|
@ -8627,12 +8624,10 @@ int DoMineStuck(DSWActor* actor)
|
|||
DSWActor* attachActor = actor->user.attachActor;
|
||||
if (attachActor != nullptr)
|
||||
{
|
||||
USERp au = attachActor->u();
|
||||
|
||||
ASSERT(au);
|
||||
ASSERT(attachActor->hasU());
|
||||
|
||||
// Is it attached to a dead actor? Blow it up if so.
|
||||
if (TEST(au->Flags, SPR_DEAD) && actor->user.Counter2 < MINE_DETONATE_STATE)
|
||||
if (TEST(attachActor->user.Flags, SPR_DEAD) && actor->user.Counter2 < MINE_DETONATE_STATE)
|
||||
{
|
||||
actor->user.Counter2 = MINE_DETONATE_STATE;
|
||||
actor->user.WaitTics = SEC(1)/2;
|
||||
|
@ -8833,7 +8828,6 @@ int DoMine(DSWActor* actor)
|
|||
// check to see if sprite is player or enemy
|
||||
if (TEST(hitActor->spr.extra, SPRX_PLAYER_OR_ENEMY))
|
||||
{
|
||||
USERp uo;
|
||||
PLAYERp pp;
|
||||
|
||||
// attach weapon to sprite
|
||||
|
@ -8843,11 +8837,9 @@ int DoMine(DSWActor* actor)
|
|||
auto own = GetOwner(actor);
|
||||
if (own && own->hasU())
|
||||
{
|
||||
uo = own->u();
|
||||
|
||||
if (uo->PlayerP)
|
||||
if (own->user.PlayerP)
|
||||
{
|
||||
pp = uo->PlayerP;
|
||||
pp = own->user.PlayerP;
|
||||
|
||||
if (RandomRange(1000) > 800)
|
||||
PlayerSound(DIGI_STICKYGOTU1, v3df_follow|v3df_dontpan,pp);
|
||||
|
|
Loading…
Reference in a new issue