mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 22:51:50 +00:00
- all nu not referring to actorNew->u()
This commit is contained in:
parent
b49e3201ae
commit
38224f05b7
3 changed files with 38 additions and 45 deletions
|
@ -1269,23 +1269,23 @@ void PreDrawStackedWater(void)
|
||||||
if (actorNew != nullptr)
|
if (actorNew != nullptr)
|
||||||
{
|
{
|
||||||
// spawn a user
|
// spawn a user
|
||||||
auto nu = actorNew->allocUser();
|
actorNew->allocUser();
|
||||||
|
|
||||||
nu->xchange = -989898;
|
actorNew->user.xchange = -989898;
|
||||||
|
|
||||||
// copy everything reasonable from the user that
|
// copy everything reasonable from the user that
|
||||||
// analyzesprites() needs to draw the image
|
// analyzesprites() needs to draw the image
|
||||||
nu->State = u->State;
|
actorNew->user.State = u->State;
|
||||||
nu->Rot = u->Rot;
|
actorNew->user.Rot = u->Rot;
|
||||||
nu->StateStart = u->StateStart;
|
actorNew->user.StateStart = u->StateStart;
|
||||||
nu->StateEnd = u->StateEnd;
|
actorNew->user.StateEnd = u->StateEnd;
|
||||||
nu->Flags = u->Flags;
|
actorNew->user.Flags = u->Flags;
|
||||||
nu->Flags2 = u->Flags2;
|
actorNew->user.Flags2 = u->Flags2;
|
||||||
nu->RotNum = u->RotNum;
|
actorNew->user.RotNum = u->RotNum;
|
||||||
nu->ID = u->ID;
|
actorNew->user.ID = u->ID;
|
||||||
|
|
||||||
nu->PlayerP = u->PlayerP;
|
actorNew->user.PlayerP = u->PlayerP;
|
||||||
nu->spal = u->spal;
|
actorNew->user.spal = u->spal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1608,29 +1608,26 @@ void SpawnFlashBombOnActor(DSWActor* actor)
|
||||||
{
|
{
|
||||||
int sizez = (ActorSizeZ(actor) * 5) >> 2;
|
int sizez = (ActorSizeZ(actor) * 5) >> 2;
|
||||||
|
|
||||||
auto nu = flameActor->u();
|
if (flameActor->user.Counter >= GetRepeatFromHeight(flameActor, sizez))
|
||||||
|
|
||||||
|
|
||||||
if (nu->Counter >= GetRepeatFromHeight(flameActor, sizez))
|
|
||||||
{
|
{
|
||||||
// keep flame only slightly bigger than the enemy itself
|
// keep flame only slightly bigger than the enemy itself
|
||||||
nu->Counter = GetRepeatFromHeight(flameActor, sizez) * 2;
|
flameActor->user.Counter = GetRepeatFromHeight(flameActor, sizez) * 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// increase max size
|
// increase max size
|
||||||
nu->Counter += GetRepeatFromHeight(flameActor, 8 << 8) * 2;
|
flameActor->user.Counter += GetRepeatFromHeight(flameActor, 8 << 8) * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Counter is max size
|
// Counter is max size
|
||||||
if (nu->Counter >= 230)
|
if (flameActor->user.Counter >= 230)
|
||||||
{
|
{
|
||||||
// this is far too big
|
// this is far too big
|
||||||
nu->Counter = 230;
|
flameActor->user.Counter = 230;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nu->WaitTics < 2 * 120)
|
if (flameActor->user.WaitTics < 2 * 120)
|
||||||
nu->WaitTics = 2 * 120; // allow it to grow again
|
flameActor->user.WaitTics = 2 * 120; // allow it to grow again
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9958,31 +9958,30 @@ void SpawnFireballFlames(DSWActor* actor, DSWActor* enemyActor)
|
||||||
if (flameActor != nullptr)
|
if (flameActor != nullptr)
|
||||||
{
|
{
|
||||||
int sizez = ActorSizeZ(enemyActor) + (ActorSizeZ(enemyActor) >> 2);
|
int sizez = ActorSizeZ(enemyActor) + (ActorSizeZ(enemyActor) >> 2);
|
||||||
auto nu = flameActor->u();
|
|
||||||
|
|
||||||
if (TEST(enemyActor->spr.extra, SPRX_BURNABLE))
|
if (TEST(enemyActor->spr.extra, SPRX_BURNABLE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (nu->Counter >= GetRepeatFromHeight(flameActor, sizez))
|
if (flameActor->user.Counter >= GetRepeatFromHeight(flameActor, sizez))
|
||||||
{
|
{
|
||||||
// keep flame only slightly bigger than the enemy itself
|
// keep flame only slightly bigger than the enemy itself
|
||||||
nu->Counter = GetRepeatFromHeight(flameActor, sizez);
|
flameActor->user.Counter = GetRepeatFromHeight(flameActor, sizez);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//increase max size
|
//increase max size
|
||||||
nu->Counter += GetRepeatFromHeight(flameActor, 8<<8);
|
flameActor->user.Counter += GetRepeatFromHeight(flameActor, 8<<8);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Counter is max size
|
// Counter is max size
|
||||||
if (nu->Counter >= 230)
|
if (flameActor->user.Counter >= 230)
|
||||||
{
|
{
|
||||||
// this is far too big
|
// this is far too big
|
||||||
nu->Counter = 230;
|
flameActor->user.Counter = 230;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nu->WaitTics < 2*120)
|
if (flameActor->user.WaitTics < 2*120)
|
||||||
nu->WaitTics = 2*120; // allow it to grow again
|
flameActor->user.WaitTics = 2*120; // allow it to grow again
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -13095,7 +13094,6 @@ int InitStar(PLAYERp pp)
|
||||||
for (size_t i = 0; i < countof(dang); i++)
|
for (size_t i = 0; i < countof(dang); i++)
|
||||||
{
|
{
|
||||||
auto actorNew2 = SpawnActor(STAT_MISSILE, STAR1, s_Star, pp->cursector, nx, ny, nz, NORM_ANGLE(actorNew->spr.ang + dang[i]), actorNew->spr.xvel);
|
auto actorNew2 = SpawnActor(STAT_MISSILE, STAR1, s_Star, pp->cursector, nx, ny, nz, NORM_ANGLE(actorNew->spr.ang + dang[i]), actorNew->spr.xvel);
|
||||||
nu = actorNew2->u();
|
|
||||||
|
|
||||||
SetOwner(GetOwner(actorNew), actorNew2);
|
SetOwner(GetOwner(actorNew), actorNew2);
|
||||||
actorNew2->spr.yrepeat = actorNew2->spr.xrepeat = STAR_REPEAT;
|
actorNew2->spr.yrepeat = actorNew2->spr.xrepeat = STAR_REPEAT;
|
||||||
|
@ -13103,14 +13101,14 @@ int InitStar(PLAYERp pp)
|
||||||
|
|
||||||
actorNew2->spr.extra = actorNew->spr.extra;
|
actorNew2->spr.extra = actorNew->spr.extra;
|
||||||
actorNew2->spr.clipdist = actorNew->spr.clipdist;
|
actorNew2->spr.clipdist = actorNew->spr.clipdist;
|
||||||
nu->WeaponNum = wu->WeaponNum;
|
actorNew2->user.WeaponNum = wu->WeaponNum;
|
||||||
nu->Radius = wu->Radius;
|
actorNew2->user.Radius = wu->Radius;
|
||||||
nu->ceiling_dist = wu->ceiling_dist;
|
actorNew2->user.ceiling_dist = wu->ceiling_dist;
|
||||||
nu->floor_dist = wu->floor_dist;
|
actorNew2->user.floor_dist = wu->floor_dist;
|
||||||
nu->Flags2 = wu->Flags2 & ~(SPR2_FLAMEDIE); // mask out any new flags here for safety.
|
actorNew2->user.Flags2 = wu->Flags2 & ~(SPR2_FLAMEDIE); // mask out any new flags here for safety.
|
||||||
|
|
||||||
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actorNew2))
|
if (TEST(pp->Flags, PF_DIVING) || SpriteInUnderwaterArea(actorNew2))
|
||||||
SET(nu->Flags, SPR_UNDERWATER);
|
SET(actorNew2->user.Flags, SPR_UNDERWATER);
|
||||||
|
|
||||||
zvel = -MulScale(pp->horizon.horiz.asq16(), HORIZ_MULT+STAR_HORIZ_ADJ, 16);
|
zvel = -MulScale(pp->horizon.horiz.asq16(), HORIZ_MULT+STAR_HORIZ_ADJ, 16);
|
||||||
actorNew2->spr.zvel = zvel >> 1;
|
actorNew2->spr.zvel = zvel >> 1;
|
||||||
|
@ -13124,9 +13122,9 @@ int InitStar(PLAYERp pp)
|
||||||
// move the same as middle star
|
// move the same as middle star
|
||||||
zvel = wu->zchange;
|
zvel = wu->zchange;
|
||||||
|
|
||||||
nu->xchange = MOVEx(actorNew2->spr.xvel, actorNew2->spr.ang);
|
actorNew2->user.xchange = MOVEx(actorNew2->spr.xvel, actorNew2->spr.ang);
|
||||||
nu->ychange = MOVEy(actorNew2->spr.xvel, actorNew2->spr.ang);
|
actorNew2->user.ychange = MOVEy(actorNew2->spr.xvel, actorNew2->spr.ang);
|
||||||
nu->zchange = zvel;
|
actorNew2->user.zchange = zvel;
|
||||||
|
|
||||||
actorNew2->spr.backuppos();
|
actorNew2->spr.backuppos();
|
||||||
}
|
}
|
||||||
|
@ -18230,7 +18228,6 @@ int QueueFootPrint(DSWActor* actor)
|
||||||
{
|
{
|
||||||
DSWActor* spawnedActor;
|
DSWActor* spawnedActor;
|
||||||
USERp u = actor->u();
|
USERp u = actor->u();
|
||||||
USERp nu;
|
|
||||||
short rnd_num=0;
|
short rnd_num=0;
|
||||||
bool Found=false;
|
bool Found=false;
|
||||||
SECTORp sectp = actor->spr.sector();
|
SECTORp sectp = actor->spr.sector();
|
||||||
|
@ -18286,7 +18283,6 @@ int QueueFootPrint(DSWActor* actor)
|
||||||
u->PlayerP->NumFootPrints--;
|
u->PlayerP->NumFootPrints--;
|
||||||
|
|
||||||
|
|
||||||
nu = spawnedActor->u();
|
|
||||||
spawnedActor->spr.hitag = 0;
|
spawnedActor->spr.hitag = 0;
|
||||||
spawnedActor->spr.xrepeat = 48;
|
spawnedActor->spr.xrepeat = 48;
|
||||||
spawnedActor->spr.yrepeat = 54;
|
spawnedActor->spr.yrepeat = 54;
|
||||||
|
@ -18298,14 +18294,14 @@ int QueueFootPrint(DSWActor* actor)
|
||||||
spawnedActor->spr.xoffset = spawnedActor->spr.yoffset = 0;
|
spawnedActor->spr.xoffset = spawnedActor->spr.yoffset = 0;
|
||||||
spawnedActor->spr.pos = actor->spr.pos;
|
spawnedActor->spr.pos = actor->spr.pos;
|
||||||
spawnedActor->spr.ang = actor->spr.ang;
|
spawnedActor->spr.ang = actor->spr.ang;
|
||||||
RESET(nu->Flags, SPR_SHADOW);
|
RESET(spawnedActor->user.Flags, SPR_SHADOW);
|
||||||
switch (FootMode)
|
switch (FootMode)
|
||||||
{
|
{
|
||||||
case BLOOD_FOOT:
|
case BLOOD_FOOT:
|
||||||
nu->spal = spawnedActor->spr.pal = PALETTE_PLAYER3; // Turn blue to blood red
|
spawnedActor->user.spal = spawnedActor->spr.pal = PALETTE_PLAYER3; // Turn blue to blood red
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
nu->spal = spawnedActor->spr.pal = PALETTE_PLAYER1; // Gray water
|
spawnedActor->user.spal = spawnedActor->spr.pal = PALETTE_PLAYER1; // Gray water
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue