- refactored the main User array into something that's automatically managed.

This commit is contained in:
Christoph Oelckers 2021-04-02 11:13:33 +02:00
parent cd45a1f035
commit bbb53bc717
46 changed files with 977 additions and 1003 deletions

View file

@ -60,7 +60,7 @@ int
DoScaleSprite(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int scale_value;
if (u->scale_speed)
@ -92,7 +92,7 @@ DoScaleSprite(short SpriteNum)
int
DoActorDie(short SpriteNum, short weapon)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = &sprite[SpriteNum];
@ -299,7 +299,7 @@ DoDebrisCurrent(SPRITEp sp)
{
int nx, ny;
int ret=0;
USERp u = User[sp - sprite];
USERp u = User[sp - sprite].Data();
SECT_USERp sectu = SectUser[sp->sectnum];
//sp->clipdist = (256+128)>>2;
@ -329,7 +329,7 @@ int
DoActorSectorDamage(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SECT_USERp sectu = SectUser[sp->sectnum];
SECTORp sectp = &sector[sp->sectnum];
@ -396,7 +396,7 @@ DoActorSectorDamage(short SpriteNum)
int
move_debris(short SpriteNum, int xchange, int ychange, int zchange)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
u->ret = move_sprite(SpriteNum, xchange, ychange, zchange,
u->ceiling_dist, u->floor_dist, 0, ACTORMOVETICS);
@ -411,7 +411,7 @@ int
DoActorDebris(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SECTORp sectp = &sector[sp->sectnum];
int nx, ny;
@ -475,7 +475,7 @@ int
DoFireFly(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int nx, ny;
nx = 4 * ACTORMOVETICS * bcos(sp->ang) >> 14;
@ -497,7 +497,7 @@ int
DoGenerateSewerDebris(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
short n;
static STATEp Debris[] =
@ -527,7 +527,7 @@ DoGenerateSewerDebris(short SpriteNum)
void
KeepActorOnFloor(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
SECTORp sectp;
int depth;
@ -619,7 +619,7 @@ KeepActorOnFloor(short SpriteNum)
int
DoActorBeginSlide(short SpriteNum, short ang, short vel, short dec)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SET(u->Flags, SPR_SLIDING);
@ -638,7 +638,7 @@ DoActorBeginSlide(short SpriteNum, short ang, short vel, short dec)
int
DoActorSlide(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int nx, ny;
nx = MulScale(u->slide_vel, bcos(u->slide_ang), 14);
@ -665,7 +665,7 @@ DoActorSlide(short SpriteNum)
int
DoActorBeginJump(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SET(u->Flags, SPR_JUMPING);
RESET(u->Flags, SPR_FALLING);
@ -695,7 +695,7 @@ DoActorBeginJump(short SpriteNum)
int
DoActorJump(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
int jump_adj;
@ -741,7 +741,7 @@ DoActorJump(short SpriteNum)
int
DoActorBeginFall(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SET(u->Flags, SPR_FALLING);
RESET(u->Flags, SPR_JUMPING);
@ -773,7 +773,7 @@ DoActorBeginFall(short SpriteNum)
int
DoActorFall(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
// adjust jump speed by gravity
@ -794,7 +794,7 @@ DoActorFall(short SpriteNum)
int
DoActorStopFall(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
sp->z = u->loz;
@ -847,7 +847,7 @@ DoActorDeathMove(short SpriteNum)
{
ANIMATOR DoFindGround;
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
int nx, ny;
@ -876,7 +876,7 @@ DoActorDeathMove(short SpriteNum)
int
DoBeginJump(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SET(u->Flags, SPR_JUMPING);
RESET(u->Flags, SPR_FALLING);
@ -892,7 +892,7 @@ DoBeginJump(short SpriteNum)
int
DoJump(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
int jump_adj;
@ -932,7 +932,7 @@ DoJump(short SpriteNum)
int
DoBeginFall(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SET(u->Flags, SPR_FALLING);
RESET(u->Flags, SPR_JUMPING);
@ -948,7 +948,7 @@ DoBeginFall(short SpriteNum)
int
DoFall(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
// adjust jump speed by gravity
@ -970,7 +970,7 @@ DoFall(short SpriteNum)
int
DoFall(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
// adjust jump speed by gravity

View file

@ -79,7 +79,7 @@ Distance(int x1, int y1, int x2, int y2)
void DebugMoveHit(short SpriteNum)
{
SPRITEp sp;
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
return;
@ -116,7 +116,7 @@ void DebugMoveHit(short SpriteNum)
bool ActorMoveHitReact(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
// Should only return true if there is a reaction to what was hit that
// would cause the calling function to abort
@ -129,7 +129,7 @@ bool ActorMoveHitReact(short SpriteNum)
USERp hu;
ANIMATORp action;
hu = User[HitSprite];
hu = User[HitSprite].Data();
// if you ran into a player - call close range functions
@ -163,7 +163,7 @@ bool ActorMoveHitReact(short SpriteNum)
bool ActorFlaming(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
if (u->flame >= 0)
@ -186,7 +186,7 @@ bool ActorFlaming(short SpriteNum)
void
DoActorSetSpeed(short SpriteNum, uint8_t speed)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
@ -252,7 +252,7 @@ ChooseActionNumber(short decision[])
int
DoActorNoise(ANIMATORp Action, short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (Action == InitActorAmbientNoise)
{
@ -310,7 +310,7 @@ DoActorNoise(ANIMATORp Action, short SpriteNum)
bool CanSeePlayer(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
// if actor can still see the player
@ -328,7 +328,7 @@ bool CanSeePlayer(short SpriteNum)
int
CanHitPlayer(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP, hp;
hitdata_t hitinfo;
int xvect,yvect,zvect;
@ -391,7 +391,7 @@ int
DoActorPickClosePlayer(short SpriteNum)
{
//extern short Zombies;
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
int dist, near_dist = MAX_ACTIVE_RANGE, a,b,c;
short pnum;
@ -515,7 +515,7 @@ TARGETACTOR:
int
GetPlayerSpriteNum(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
short pnum;
PLAYERp pp;
@ -546,7 +546,7 @@ CloseRangeDist(SPRITEp sp1, SPRITEp sp2)
int DoActorOperate(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
short nearsector, nearwall, nearsprite;
int nearhitdist;
int z[2];
@ -634,7 +634,7 @@ DECISION GenericFlaming[] =
ANIMATORp
DoActorActionDecide(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
int dist;
ANIMATORp action;
@ -706,7 +706,7 @@ DoActorActionDecide(short SpriteNum)
}
pu = User[GetPlayerSpriteNum(SpriteNum)];
pu = User[GetPlayerSpriteNum(SpriteNum)].Data();
// check for short range attack possibility
if ((dist < CloseRangeDist(sp, u->tgt_sp) && ICanSee) ||
(pu && pu->WeaponNum == WPN_FIST && u->ID != RIPPER2_RUN_R0 && u->ID != RIPPER_RUN_R0))
@ -822,7 +822,7 @@ DoActorActionDecide(short SpriteNum)
int
InitActorDecide(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
// NOTE: It is possible to overflow the stack with too many calls to this
// routine
@ -842,7 +842,7 @@ InitActorDecide(short SpriteNum)
int
DoActorDecide(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
ANIMATORp actor_action;
@ -898,7 +898,7 @@ int sw_snd_scratch = 0;
int
InitActorAlertNoise(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
sw_snd_scratch = 1;
// MONO_PRINT(strcpy(ds,"Init Actor Threat Noise"));
@ -914,7 +914,7 @@ InitActorAlertNoise(short SpriteNum)
int
InitActorAmbientNoise(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
sw_snd_scratch = 2;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -930,7 +930,7 @@ InitActorAmbientNoise(short SpriteNum)
int
InitActorAttackNoise(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
sw_snd_scratch = 3;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -946,7 +946,7 @@ InitActorAttackNoise(short SpriteNum)
int
InitActorPainNoise(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
sw_snd_scratch = 4;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -962,7 +962,7 @@ InitActorPainNoise(short SpriteNum)
int
InitActorDieNoise(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
sw_snd_scratch = 5;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -978,7 +978,7 @@ InitActorDieNoise(short SpriteNum)
int
InitActorExtra1Noise(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
sw_snd_scratch = 6;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -993,7 +993,7 @@ InitActorExtra1Noise(short SpriteNum)
int
InitActorExtra2Noise(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
sw_snd_scratch = 7;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -1008,7 +1008,7 @@ InitActorExtra2Noise(short SpriteNum)
int
InitActorExtra3Noise(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
sw_snd_scratch = 8;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -1023,7 +1023,7 @@ InitActorExtra3Noise(short SpriteNum)
int
InitActorExtra4Noise(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
sw_snd_scratch = 9;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -1038,7 +1038,7 @@ InitActorExtra4Noise(short SpriteNum)
int
InitActorExtra5Noise(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
sw_snd_scratch = 10;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -1053,7 +1053,7 @@ InitActorExtra5Noise(short SpriteNum)
int
InitActorExtra6Noise(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
sw_snd_scratch = 11;
// MONO_PRINT(strcpy(ds,"Init Actor Move Noise"));
@ -1073,7 +1073,7 @@ InitActorExtra6Noise(short SpriteNum)
int
InitActorMoveCloser(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
//MONO_PRINT("Init Actor Move Closer\n");
@ -1090,7 +1090,7 @@ InitActorMoveCloser(short SpriteNum)
int
DoActorCantMoveCloser(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
//MONO_PRINT("Can't move closer\n");
@ -1123,7 +1123,7 @@ DoActorCantMoveCloser(short SpriteNum)
int
DoActorMoveCloser(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
int nx, ny;
@ -1367,7 +1367,7 @@ FindWanderTrack(USERp u)
int
InitActorRunAway(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
//MONO_PRINT("Init Actor RunAway\n");
@ -1398,7 +1398,7 @@ InitActorRunAway(short SpriteNum)
int
InitActorRunToward(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
//MONO_PRINT("InitActorRunToward\n");
@ -1421,7 +1421,7 @@ InitActorRunToward(short SpriteNum)
int
InitActorAttack(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
// zombie is attacking a player
@ -1442,7 +1442,7 @@ InitActorAttack(short SpriteNum)
return 0;
}
if (User[u->tgt_sp-sprite] &&
if (User[u->tgt_sp-sprite].Data() &&
User[u->tgt_sp-sprite]->Health <= 0)
{
DoActorPickClosePlayer(SpriteNum);
@ -1458,7 +1458,7 @@ InitActorAttack(short SpriteNum)
// if the guy you are after is dead, look for another and
// reposition
if (User[u->tgt_sp-sprite] &&
if (User[u->tgt_sp-sprite].Data() &&
User[u->tgt_sp-sprite]->PlayerP &&
TEST(User[u->tgt_sp-sprite]->PlayerP->Flags, PF_DEAD))
{
@ -1526,7 +1526,7 @@ InitActorAttack(short SpriteNum)
int
DoActorAttack(short SpriteNum)
{
USERp u = User[SpriteNum],pu;
USERp u = User[SpriteNum].Data(),pu;
SPRITEp sp = User[SpriteNum]->SpriteP;
short rand_num;
int dist,a,b,c;
@ -1535,7 +1535,7 @@ DoActorAttack(short SpriteNum)
DISTANCE(sp->x, sp->y, u->tgt_sp->x, u->tgt_sp->y, dist, a, b, c);
pu = User[GetPlayerSpriteNum(SpriteNum)];
pu = User[GetPlayerSpriteNum(SpriteNum)].Data();
if ((u->ActorActionSet->CloseAttack[0] && dist < CloseRangeDist(sp, u->tgt_sp)) ||
(pu && pu->WeaponNum == WPN_FIST)) // JBF: added null check
{
@ -1563,7 +1563,7 @@ DoActorAttack(short SpriteNum)
int
InitActorEvade(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
//MONO_PRINT("Init Actor Evade\n");
@ -1591,7 +1591,7 @@ InitActorEvade(short SpriteNum)
int
InitActorWanderAround(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
//DSPRINTF(ds, "InitActorWanderAround\n");
@ -1616,7 +1616,7 @@ InitActorWanderAround(short SpriteNum)
int
InitActorFindPlayer(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
int DoActorFindPlayer(short SpriteNum);
@ -1649,7 +1649,7 @@ InitActorFindPlayer(short SpriteNum)
int
InitActorDuck(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
short dist;
@ -1685,7 +1685,7 @@ InitActorDuck(short SpriteNum)
int
DoActorDuck(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if ((u->WaitTics -= ACTORMOVETICS) < 0)
{
@ -1701,7 +1701,7 @@ DoActorDuck(short SpriteNum)
int
DoActorMoveJump(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
int nx, ny;
@ -1723,7 +1723,7 @@ DoActorMoveJump(short SpriteNum)
int move_scan(short SpriteNum, short ang, int dist, int *stopx, int *stopy, int *stopz, short *stopsect)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
int nx,ny;
@ -1789,7 +1789,7 @@ int move_scan(short SpriteNum, short ang, int dist, int *stopx, int *stopy, int
int
FindNewAngle(short SpriteNum, signed char dir, int DistToMove)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
static short toward_angle_delta[4][9] =
@ -1932,7 +1932,7 @@ int
InitActorReposition(short SpriteNum)
{
int DoActorReposition(short SpriteNum);
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
short ang;
int rnum;
@ -2038,7 +2038,7 @@ InitActorReposition(short SpriteNum)
int
DoActorReposition(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
int nx, ny;
@ -2069,7 +2069,7 @@ DoActorReposition(short SpriteNum)
int
InitActorPause(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
u->ActorActionFunc = DoActorPause;
@ -2085,7 +2085,7 @@ InitActorPause(short SpriteNum)
int
DoActorPause(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
// Using Vis instead of WaitTics, var name sucks, but it's the same type
// WaitTics is used by too much other actor code and causes problems here
@ -2106,7 +2106,7 @@ int
InitActorReposition(short SpriteNum)
{
int DoActorReposition(short SpriteNum);
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
//MONO_PRINT("InitActorReposition\n");
@ -2125,7 +2125,7 @@ InitActorReposition(short SpriteNum)
int
DoActorReposition(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
int nx, ny;
@ -2148,7 +2148,7 @@ DoActorReposition(short SpriteNum)
int
InitActorPause(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
//MONO_PRINT("InitActorPause\n");
@ -2165,7 +2165,7 @@ InitActorPause(short SpriteNum)
int
DoActorPause(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
if ((u->WaitTics -= ACTORMOVETICS) < 0)

View file

@ -845,7 +845,7 @@ bool HitBreakWall(WALLp wp, int hit_x, int hit_y, int hit_z, short ang, short ty
int KillBreakSprite(short BreakSprite)
{
SPRITEp bp = &sprite[BreakSprite];
USERp bu = User[BreakSprite];
USERp bu = User[BreakSprite].Data();
// Does not actually kill the sprite so it will be valid for the rest
// of the loop traversal.
@ -1047,7 +1047,7 @@ bool NullActor(USERp u)
int HitBreakSprite(short BreakSprite, short type)
{
SPRITEp bp = &sprite[BreakSprite];
USERp bu = User[BreakSprite];
USERp bu = User[BreakSprite].Data();
//SPRITEp sp;
// ignore as a breakable if true

View file

@ -731,12 +731,12 @@ SetupBunny(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum, BUNNY_RUN_R0, s_BunnyRun[0]);
u = SpawnUser(SpriteNum, BUNNY_RUN_R0, s_BunnyRun[0]);
u->Health = 10;
}
@ -825,7 +825,7 @@ GetBunnyJumpHeight(short jump_speed, short jump_grav)
int
PickBunnyJumpSpeed(short SpriteNum, int pix_height)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
ASSERT(pix_height < 128);
@ -853,7 +853,7 @@ int
DoBunnyBeginJumpAttack(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp psp = User[SpriteNum]->tgt_sp;
short tang;
@ -888,7 +888,7 @@ int
DoBunnyMoveJump(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
@ -922,7 +922,7 @@ DoBunnyMoveJump(short SpriteNum)
int
DoPickCloseBunny(short SpriteNum)
{
USERp u = User[SpriteNum],tu;
USERp u = User[SpriteNum].Data(), tu;
SPRITEp sp = &sprite[SpriteNum],tsp;
int dist, near_dist = 1000, a,b,c;
int i;
@ -936,7 +936,7 @@ DoPickCloseBunny(short SpriteNum)
while ((i = it.NextIndex()) >= 0)
{
tsp = &sprite[i];
tu = User[i];
tu = User[i].Data();
if (sp == tsp) continue;
@ -963,7 +963,7 @@ int
DoBunnyQuickJump(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (u->spal != PALETTE_PLAYER8) return false;
@ -975,7 +975,7 @@ DoBunnyQuickJump(short SpriteNum)
{
short hit_sprite = u->lo_sp - sprite;
SPRITEp tsp = u->lo_sp;
USERp tu = User[hit_sprite];
USERp tu = User[hit_sprite].Data();
if (!tu || tu->ID != BUNNY_RUN_R0) return false;
@ -1017,7 +1017,7 @@ DoBunnyQuickJump(short SpriteNum)
{
short hit_sprite = u->lo_sp - sprite;
SPRITEp tsp = u->lo_sp;
USERp tu = User[hit_sprite];
USERp tu = User[hit_sprite].Data();
if (!tu || tu->ID != BUNNY_RUN_R0) return false;
@ -1103,7 +1103,7 @@ DoBunnyQuickJump(short SpriteNum)
int
NullBunny(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
@ -1129,7 +1129,7 @@ NullBunny(short SpriteNum)
int DoBunnyPain(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
NullBunny(SpriteNum);
@ -1141,7 +1141,7 @@ int DoBunnyPain(short SpriteNum)
int DoBunnyRipHeart(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp tsp = u->tgt_sp;
@ -1156,7 +1156,7 @@ int DoBunnyRipHeart(short SpriteNum)
int DoBunnyStandKill(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
NullBunny(SpriteNum);
@ -1172,7 +1172,7 @@ int DoBunnyStandKill(short SpriteNum)
void BunnyHatch(short Weapon)
{
SPRITEp wp = &sprite[Weapon];
USERp wu = User[Weapon];
USERp wu = User[Weapon].Data();
short New,i;
SPRITEp np;
@ -1198,7 +1198,7 @@ void BunnyHatch(short Weapon)
np->ang = rip_ang[i];
np->pal = 0;
SetupBunny(New);
nu = User[New];
nu = User[New].Data();
np->shade = wp->shade;
// make immediately active
@ -1267,7 +1267,7 @@ int BunnyHatch2(short Weapon)
np->ang = RANDOM_P2(2048);
np->pal = 0;
SetupBunny(New);
nu = User[New];
nu = User[New].Data();
np->shade = wp->shade;
// make immediately active
@ -1320,7 +1320,7 @@ int
DoBunnyMove(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
// Parental lock crap
if (TEST(sp->cstat, CSTAT_SPRITE_INVISIBLE))
@ -1403,7 +1403,7 @@ int
DoBunnyEat(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
@ -1455,7 +1455,7 @@ int
DoBunnyScrew(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
@ -1505,7 +1505,7 @@ int
DoBunnyGrowUp(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (sp->pal == PALETTE_PLAYER1) return 0; // Don't bother white bunnies

View file

@ -356,7 +356,7 @@ PreCacheActor(void)
if (sprite[i].statnum >= MAXSTATUS)
continue;
if (User[i])
if (User[i].Data())
pic = User[i]->ID;
else
pic = sprite[i].picnum;

View file

@ -501,7 +501,7 @@ void
CoolgCommon(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
sp->clipdist = (200) >> 2;
//u->floor_dist = Z(5);
@ -524,12 +524,12 @@ SetupCoolg(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,COOLG_RUN_R0,s_CoolgRun[0]);
u = SpawnUser(SpriteNum,COOLG_RUN_R0,s_CoolgRun[0]);
u->Health = HEALTH_COOLIE_GHOST;
}
@ -553,7 +553,7 @@ extern short TotalKillable;
int
NewCoolg(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
USERp nu;
SPRITEp np;
@ -562,7 +562,7 @@ NewCoolg(short SpriteNum)
New = SpawnSprite(STAT_ENEMY, COOLG_RUN_R0, &s_CoolgBirth[0], sp->sectnum, sp->x, sp->y, sp->z, sp->ang, 50);
nu = User[New];
nu = User[New].Data();
np = &sprite[New];
ChangeState(New, &s_CoolgBirth[0]);
@ -590,7 +590,7 @@ DoCoolgBirth(short New)
USERp u;
ANIMATOR DoActorDecide;
u = User[New];
u = User[New].Data();
u->Health = HEALTH_COOLIE_GHOST;
u->Attrib = &CoolgAttrib;
@ -612,7 +612,7 @@ DoCoolgBirth(short New)
int NullCoolg(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
u->ShellNum -= ACTORMOVETICS;
@ -630,7 +630,7 @@ int NullCoolg(short SpriteNum)
int DoCoolgMatchPlayerZ(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp tsp = User[SpriteNum]->tgt_sp;
int zdiff,zdist;
int loz,hiz;
@ -712,7 +712,7 @@ int DoCoolgMatchPlayerZ(short SpriteNum)
int InitCoolgCircle(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
u->ActorActionFunc = DoCoolgCircle;
@ -745,7 +745,7 @@ int InitCoolgCircle(short SpriteNum)
int DoCoolgCircle(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int nx,ny,bound;
@ -788,7 +788,7 @@ int
DoCoolgDeath(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int nx, ny;
@ -833,7 +833,7 @@ DoCoolgDeath(short SpriteNum)
int DoCoolgMove(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if ((u->ShellNum -= ACTORMOVETICS) <= 0)
{
@ -918,7 +918,7 @@ int DoCoolgMove(short SpriteNum)
int DoCoolgPain(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
NullCoolg(SpriteNum);

View file

@ -406,7 +406,7 @@ ACTOR_ACTION_SET CoolieActionSet =
void EnemyDefaults(short SpriteNum, ACTOR_ACTION_SETp action, PERSONALITYp person)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = &sprite[SpriteNum];
unsigned int wpn;
short wpn_cnt;
@ -531,12 +531,12 @@ SetupCoolie(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,COOLIE_RUN_R0,s_CoolieRun[0]);
u = SpawnUser(SpriteNum,COOLIE_RUN_R0,s_CoolieRun[0]);
u->Health = HEALTH_COOLIE;
}
@ -576,7 +576,7 @@ int SpawnCoolg(short SpriteNum)
int CooliePain(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
@ -594,7 +594,7 @@ int CooliePain(short SpriteNum)
int NullCoolie(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
@ -610,7 +610,7 @@ int NullCoolie(short SpriteNum)
int DoCoolieMove(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
@ -660,7 +660,7 @@ DoCoolieWaitBirth(short SpriteNum)
{
USERp u;
u = User[SpriteNum];
u = User[SpriteNum].Data();
if ((u->Counter -= ACTORMOVETICS) <= 0)
{

View file

@ -148,7 +148,7 @@ void CopySectorMatch(short match)
// kill anything not invisible
if (!TEST(k->cstat, CSTAT_SPRITE_INVISIBLE))
{
if (User[kill])
if (User[kill].Data())
{
// be safe with the killing
//SetSuicide(kill);

View file

@ -104,7 +104,7 @@ GetRotation(short tSpriteNum, int viewx, int viewy)
short rotation;
tspriteptr_t tsp = &tsprite[tSpriteNum];
USERp tu = User[tsp->owner];
USERp tu = User[tsp->owner].Data();
short angle2;
if (tu->RotNum == 0)
@ -171,7 +171,7 @@ int
SetActorRotation(short tSpriteNum, int viewx, int viewy)
{
tspriteptr_t tsp = &tsprite[tSpriteNum];
USERp tu = User[tsp->owner];
USERp tu = User[tsp->owner].Data();
short StateOffset, Rotation;
// don't modify ANY tu vars - back them up!
@ -206,7 +206,7 @@ int
DoShadowFindGroundPoint(tspriteptr_t sp)
{
// USES TSPRITE !!!!!
USERp u = User[sp->owner];
USERp u = User[sp->owner].Data();
SPRITEp hsp;
int ceilhit, florhit;
int hiz, loz = u->loz;
@ -264,7 +264,7 @@ void
DoShadows(tspriteptr_t tsp, int viewz, bool mirror)
{
tspriteptr_t New = &tsprite[spritesortcnt];
USERp tu = User[tsp->owner];
USERp tu = User[tsp->owner].Data();
int ground_dist = 0;
int view_dist = 0;
int loz;
@ -364,7 +364,7 @@ DoShadows(tspriteptr_t tsp, int viewz, bool mirror)
void
DoMotionBlur(tspritetype const * const tsp)
{
USERp tu = User[tsp->owner];
USERp tu = User[tsp->owner].Data();
int nx,ny,nz = 0,dx,dy,dz;
short i, ang;
short xrepeat, yrepeat, repeat_adj = 0;
@ -571,7 +571,7 @@ analyzesprites(int viewx, int viewy, int viewz, bool mirror)
{
SpriteNum = tsprite[tSpriteNum].owner;
tspriteptr_t tsp = &tsprite[tSpriteNum];
tu = User[SpriteNum];
tu = User[SpriteNum].Data();
#if 0
// Brighten up the sprite if set somewhere else to do so
@ -892,7 +892,7 @@ post_analyzesprites(void)
SpriteNum = tsprite[tSpriteNum].owner;
if (SpriteNum < 0) continue; // JBF: verify this is safe
tspriteptr_t tsp = &tsprite[tSpriteNum];
tu = User[SpriteNum];
tu = User[SpriteNum].Data();
if (tu)
{
@ -1060,7 +1060,7 @@ void PrintSpriteInfo(PLAYERp pp)
short hit_sprite = DoPickTarget(pp->SpriteP, 32, 2);
sp = &sprite[hit_sprite];
u = User[hit_sprite];
u = User[hit_sprite].Data();
sp->hitag = 9997; // Special tag to make the actor glow red for one frame
@ -1126,7 +1126,7 @@ void DrawCrosshair(PLAYERp pp)
if (!(CameraTestMode))
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
::DrawCrosshair(2326, u->Health, -pp->angle.look_anghalf(smoothratio), TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE) ? 5 : 0, 2, shadeToLight(10));
}
}
@ -1272,7 +1272,7 @@ PostDraw(void)
it.Reset(STAT_FAF_COPY);
while ((i = it.NextIndex()) >= 0)
{
FreeUser(i);
User[i].Clear();
deletesprite(i);
}
}
@ -1356,7 +1356,7 @@ void PreDrawStackedWater(void)
SectIterator it(sprite[si].sectnum);
while ((i = it.NextIndex()) >= 0)
{
if (User[i])
if (User[i].Data())
{
if (sprite[i].statnum == STAT_ITEM)
continue;
@ -1369,13 +1369,14 @@ void PreDrawStackedWater(void)
continue;
sp = &sprite[i];
u = User[i];
u = User[i].Data();
New = ConnectCopySprite((uspritetype const *)sp);
if (New >= 0)
{
// spawn a user
User[New] = nu = NewUser();
User[New].Alloc();
nu = User[New].Data();
ASSERT(nu != NULL);
nu->xchange = -989898;

View file

@ -361,7 +361,7 @@ void
EelCommon(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
sp->clipdist = (100) >> 2;
u->floor_dist = Z(16);
@ -384,12 +384,12 @@ SetupEel(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,EEL_RUN_R0,s_EelRun[0]);
u = SpawnUser(SpriteNum,EEL_RUN_R0,s_EelRun[0]);
u->Health = 40;
}
@ -415,7 +415,7 @@ SetupEel(short SpriteNum)
int
NewEel(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
USERp nu;
SPRITEp np;
@ -425,7 +425,7 @@ NewEel(short SpriteNum)
New = SpawnSprite(STAT_ENEMY, EEL_RUN_R0, &s_EelBirth, sp->sectnum, sp->x, sp->y, sp->z, sp->ang, 50);
nu = User[New];
nu = User[New].Data();
np = &sprite[New];
ChangeState(New, &s_EelBirth);
@ -445,7 +445,7 @@ NewEel(short SpriteNum)
int NullEel(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
@ -460,7 +460,7 @@ int NullEel(short SpriteNum)
int DoEelMatchPlayerZ(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp tsp = User[SpriteNum]->tgt_sp;
int zdiff,zdist;
int loz,hiz;
@ -561,7 +561,7 @@ int
DoEelDeath(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int nx, ny;
if (TEST(u->Flags, SPR_FALLING))
{
@ -601,7 +601,7 @@ DoEelDeath(short SpriteNum)
int DoEelMove(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
ASSERT(u->Rot != NULL);

View file

@ -480,7 +480,7 @@ void TerminateLevel(void)
StatIterator it(stat);
if ((i = it.NextIndex()) >= 0)
{
if (User[i]) puser[pnum].CopyFromUser(User[i]);
if (User[i].Data()) puser[pnum].CopyFromUser(User[i].Data());
}
}

View file

@ -1460,7 +1460,7 @@ struct USERSAVE
#define SPR2_DONT_TARGET_OWNER (BIT(24))
extern USERp User[MAXSPRITES];
extern TPointer<USER> User[MAXSPRITES];
typedef struct
{
@ -1468,20 +1468,6 @@ typedef struct
} RANGE,*RANGEp;
#pragma message ("Remove NewUser/FreeUser!")
inline USER* NewUser()
{
return new USER;
}
inline void FreeUser(int num)
{
if (User[num]) delete User[num];
User[num] = nullptr;
}
///////////////////////////////////////////////////////////////////////////////////////////
//
// Sector Stuff - Sector Objects and Tracks

View file

@ -722,12 +722,12 @@ SetupGirlNinja(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum, GIRLNINJA_RUN_R0, s_GirlNinjaRun[0]);
u = SpawnUser(SpriteNum, GIRLNINJA_RUN_R0, s_GirlNinjaRun[0]);
u->Health = 100;
}
@ -753,7 +753,7 @@ SetupGirlNinja(short SpriteNum)
int
DoGirlNinjaMove(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
// jumping and falling
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING) && !TEST(u->Flags, SPR_CLIMBING))
@ -791,7 +791,7 @@ DoGirlNinjaMove(short SpriteNum)
int
GirlNinjaJumpActionFunc(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
int nx, ny;
@ -816,7 +816,7 @@ GirlNinjaJumpActionFunc(short SpriteNum)
int
NullGirlNinja(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (u->WaitTics > 0) u->WaitTics -= ACTORMOVETICS;
@ -834,7 +834,7 @@ NullGirlNinja(short SpriteNum)
int DoGirlNinjaPain(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
NullGirlNinja(SpriteNum);
@ -847,7 +847,7 @@ int DoGirlNinjaPain(short SpriteNum)
int DoGirlNinjaSpecial(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (u->spal == PALETTE_PLAYER5)
{

View file

@ -490,12 +490,12 @@ SetupGoro(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,GORO_RUN_R0,s_GoroRun[0]);
u = SpawnUser(SpriteNum,GORO_RUN_R0,s_GoroRun[0]);
u->Health = HEALTH_GORO;
}
@ -515,7 +515,7 @@ SetupGoro(short SpriteNum)
int NullGoro(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
ASSERT(SpriteNum >= 0);
@ -530,7 +530,7 @@ int NullGoro(short SpriteNum)
int DoGoroPain(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
ASSERT(SpriteNum >= 0);
@ -543,7 +543,7 @@ int DoGoroPain(short SpriteNum)
int DoGoroMove(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
ASSERT(SpriteNum >= 0);
@ -555,7 +555,7 @@ int DoGoroMove(short SpriteNum)
else
(*u->ActorActionFunc)(SpriteNum);
ASSERT(User[SpriteNum]);
ASSERT(User[SpriteNum].Data());
KeepActorOnFloor(SpriteNum);

View file

@ -296,12 +296,12 @@ SetupHornet(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,HORNET_RUN_R0,s_HornetRun[0]);
u = SpawnUser(SpriteNum,HORNET_RUN_R0,s_HornetRun[0]);
u->Health = HEALTH_HORNET;
}
@ -334,7 +334,7 @@ SetupHornet(short SpriteNum)
int NullHornet(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
@ -349,7 +349,7 @@ int NullHornet(short SpriteNum)
int DoHornetMatchPlayerZ(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp tsp = User[SpriteNum]->tgt_sp;
int zdiff,zdist;
int loz,hiz;
@ -424,7 +424,7 @@ int DoHornetMatchPlayerZ(short SpriteNum)
int InitHornetCircle(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
u->ActorActionFunc = DoHornetCircle;
@ -456,7 +456,7 @@ int InitHornetCircle(short SpriteNum)
int DoHornetCircle(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int nx,ny,bound;
sp->ang = NORM_ANGLE(sp->ang + u->Counter2);
@ -509,7 +509,7 @@ int
DoHornetDeath(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int nx, ny;
if (TEST(u->Flags, SPR_FALLING))
@ -554,7 +554,7 @@ int DoCheckSwarm(short SpriteNum)
{
int i;
SPRITEp sp = &sprite[SpriteNum], tsp;
USERp u = User[SpriteNum], tu;
USERp u = User[SpriteNum].Data(), tu;
int dist, pdist, a,b,c;
PLAYERp pp;
@ -578,7 +578,7 @@ int DoCheckSwarm(short SpriteNum)
while ((i = it.NextIndex()) >= 0)
{
tsp = &sprite[i];
tu = User[i];
tu = User[i].Data();
if (!tu) continue;
@ -599,7 +599,7 @@ int DoCheckSwarm(short SpriteNum)
int DoHornetMove(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
// Check for swarming
// lotag of 1 = Swarm around lotags of 2

View file

@ -80,7 +80,7 @@ enum
static void processWeapon(PLAYERp const pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
int i;
if (loc.getNewWeapon() == WeaponSel_Next)
@ -120,7 +120,7 @@ static void processWeapon(PLAYERp const pp)
}
else if (loc.getNewWeapon() == WeaponSel_Prev)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
short prev_weapon = u->WeaponNum - 1;
short start_weapon;
@ -153,7 +153,7 @@ static void processWeapon(PLAYERp const pp)
}
else if (loc.getNewWeapon() == WeaponSel_Alt)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
short const which_weapon = u->WeaponNum + 1;
loc.setNewWeapon(which_weapon);
}

View file

@ -269,7 +269,7 @@ void so_updateinterpolations(void) // Stick at beginning of domovethings
{
if (data->spriteofang >= 0)
{
USERp u = User[data->spriteofang];
USERp u = User[data->spriteofang].Data();
if (u)
u->oangdiff = 0;
if (!interpolating)
@ -316,7 +316,7 @@ void so_dointerpolations(int32_t smoothratio) // Stick at b
data->lastoldipos = data->oldipos;
if (data->spriteofang >= 0)
{
USERp u = User[data->spriteofang];
USERp u = User[data->spriteofang].Data();
data->lastangdiff = u ? u->oangdiff : 0;
}
}
@ -358,7 +358,7 @@ void so_dointerpolations(int32_t smoothratio) // Stick at b
if (data->curelement >= soi_sprx)
{
int32_t sprnum = data->curelement & soi_base;
USERp u = User[sprnum];
USERp u = User[sprnum].Data();
if (u && (sprite[sprnum].statnum != STAT_DEFAULT) &&
((TEST(u->Flags, SPR_SKIP4) && (sprite[sprnum].statnum <= STAT_SKIP4_INTERP_END)) ||
(TEST(u->Flags, SPR_SKIP2) && (sprite[sprnum].statnum <= STAT_SKIP2_INTERP_END))))

View file

@ -139,7 +139,7 @@ void AutoPickInventory(PLAYERp pp)
void UseInventoryMedkit(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
short diff;
short inv = INVENTORY_MEDKIT;
short amt;

View file

@ -260,7 +260,7 @@ int
DoWallBloodDrip(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
//sp->z += (300+RANDOM_RANGE(2300)) >> 1;
@ -300,7 +300,7 @@ void
SpawnMidSplash(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp np;
USERp nu;
short New;
@ -309,7 +309,7 @@ SpawnMidSplash(short SpriteNum)
sp->x, sp->y, SPRITEp_MID(sp), sp->ang, 0);
np = &sprite[New];
nu = User[New];
nu = User[New].Data();
//SetOwner(Weapon, New);
np->shade = -12;
@ -334,7 +334,7 @@ void
SpawnFloorSplash(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp np;
USERp nu;
short New;
@ -343,7 +343,7 @@ SpawnFloorSplash(short SpriteNum)
sp->x, sp->y, sp->z, sp->ang, 0);
np = &sprite[New];
nu = User[New];
nu = User[New].Data();
//SetOwner(Weapon, New);
np->shade = -12;
@ -369,7 +369,7 @@ int
DoBloodSpray(int16_t Weapon)
{
SPRITEp sp = &sprite[Weapon];
USERp u = User[Weapon];
USERp u = User[Weapon].Data();
int cz,fz;
if (TEST(u->Flags, SPR_UNDERWATER))
@ -563,7 +563,7 @@ DoBloodSpray(int16_t Weapon)
sp->x, sp->y, sp->z, sp->ang, 100);
np = &sprite[New];
nu = User[New];
nu = User[New].Data();
SetOwner(Weapon, New);
np->shade = -12;
@ -596,7 +596,7 @@ int
DoPhosphorus(int16_t Weapon)
{
SPRITEp sp = &sprite[Weapon];
USERp u = User[Weapon];
USERp u = User[Weapon].Data();
if (TEST(u->Flags, SPR_UNDERWATER))
{
@ -636,7 +636,7 @@ DoPhosphorus(int16_t Weapon)
hit_sprite = NORM_SPRITE(u->ret);
hsp = &sprite[hit_sprite];
hu = User[hit_sprite];
hu = User[hit_sprite].Data();
if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{
@ -785,7 +785,7 @@ DoPhosphorus(int16_t Weapon)
sp->x, sp->y, sp->z, sp->ang, 100);
np = &sprite[New];
nu = User[New];
nu = User[New].Data();
np->hitag = LUMINOUS; // Always full brightness
SetOwner(Weapon, New);
@ -820,7 +820,7 @@ int
DoChemBomb(int16_t Weapon)
{
SPRITEp sp = &sprite[Weapon];
USERp u = User[Weapon];
USERp u = User[Weapon].Data();
if (TEST(u->Flags, SPR_UNDERWATER))
{
@ -1035,7 +1035,7 @@ DoChemBomb(int16_t Weapon)
sp->x, sp->y, sp->z, sp->ang, 100);
np = &sprite[New];
nu = User[New];
nu = User[New].Data();
SetOwner(Weapon, New);
np->shade = -40;
@ -1065,7 +1065,7 @@ DoChemBomb(int16_t Weapon)
int
DoCaltropsStick(int16_t Weapon)
{
USERp u = User[Weapon];
USERp u = User[Weapon].Data();
u->Counter = !u->Counter;
@ -1079,7 +1079,7 @@ int
DoCaltrops(int16_t Weapon)
{
SPRITEp sp = &sprite[Weapon];
USERp u = User[Weapon];
USERp u = User[Weapon].Data();
if (TEST(u->Flags, SPR_UNDERWATER))
{
@ -1257,7 +1257,7 @@ int
SpawnRadiationCloud(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum], np;
USERp u = User[SpriteNum], nu;
USERp u = User[SpriteNum].Data(), nu;
short New;
@ -1288,7 +1288,7 @@ SpawnRadiationCloud(short SpriteNum)
sp->x, sp->y, sp->z - RANDOM_P2(Z(8)), sp->ang, 0);
np = &sprite[New];
nu = User[New];
nu = User[New].Data();
SetOwner(sp->owner, New);
nu->WaitTics = 1 * 120;
@ -1335,7 +1335,7 @@ int
DoRadiationCloud(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
sp->z -= sp->zvel;
@ -1358,7 +1358,7 @@ DoRadiationCloud(short SpriteNum)
int
PlayerInitChemBomb(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
USERp wu;
SPRITEp wp;
int nx, ny, nz;
@ -1381,7 +1381,7 @@ PlayerInitChemBomb(PLAYERp pp)
nx, ny, nz, pp->angle.ang.asbuild(), CHEMBOMB_VELOCITY);
wp = &sprite[w];
wu = User[w];
wu = User[w].Data();
// don't throw it as far if crawling
if (TEST(pp->Flags, PF_CRAWLING))
@ -1444,7 +1444,7 @@ PlayerInitChemBomb(PLAYERp pp)
int
InitSpriteChemBomb(int16_t SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
USERp wu;
SPRITEp sp = &sprite[SpriteNum], wp;
int nx, ny, nz;
@ -1463,7 +1463,7 @@ InitSpriteChemBomb(int16_t SpriteNum)
nx, ny, nz, sp->ang, CHEMBOMB_VELOCITY);
wp = &sprite[w];
wu = User[w];
wu = User[w].Data();
SET(wu->Flags, SPR_XFLIP_TOGGLE);
@ -1498,7 +1498,7 @@ int
InitChemBomb(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
USERp wu;
SPRITEp wp;
int nx, ny, nz;
@ -1518,7 +1518,7 @@ InitChemBomb(short SpriteNum)
nx, ny, nz, sp->ang, CHEMBOMB_VELOCITY);
wp = &sprite[w];
wu = User[w];
wu = User[w].Data();
// wu->RotNum = 5;
// NewStateGroup(w, &sg_ChemBomb);
@ -1592,7 +1592,7 @@ PlayerInitFlashBomb(PLAYERp pp)
while ((i = it.NextIndex()) >= 0)
{
hp = &sprite[i];
hu = User[i];
hu = User[i].Data();
if (i == pp->PlayerSprite)
break;
@ -1660,7 +1660,7 @@ InitFlashBomb(int16_t SpriteNum)
while ((i = it.NextIndex()) >= 0)
{
hp = &sprite[i];
hu = User[i];
hu = User[i].Data();
DISTANCE(hp->x, hp->y, sp->x, sp->y, dist, tx, ty, tmin);
if (dist > 16384) // Flash radius
@ -1710,7 +1710,7 @@ int
SpawnFlashBombOnActor(int16_t enemy)
{
SPRITEp ep = &sprite[enemy];
USERp eu = User[enemy];
USERp eu = User[enemy].Data();
SPRITEp np;
USERp nu;
short New;
@ -1733,7 +1733,7 @@ SpawnFlashBombOnActor(int16_t enemy)
int sizez = SPRITEp_SIZE_Z(ep) + DIV4(SPRITEp_SIZE_Z(ep));
np = &sprite[eu->flame];
nu = User[eu->flame];
nu = User[eu->flame].Data();
if (nu->Counter >= SPRITEp_SIZE_Z_2_YREPEAT(np, sizez))
@ -1764,7 +1764,7 @@ SpawnFlashBombOnActor(int16_t enemy)
New = SpawnSprite(STAT_MISSILE, FIREBALL_FLAMES, s_FireballFlames, ep->sectnum,
ep->x, ep->y, ep->z, ep->ang, 0);
np = &sprite[New];
nu = User[New];
nu = User[New].Data();
if (enemy >= 0)
eu->flame = New;
@ -1801,7 +1801,7 @@ SpawnFlashBombOnActor(int16_t enemy)
int
PlayerInitCaltrops(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
USERp wu;
SPRITEp wp;
int nx, ny, nz;
@ -1827,7 +1827,7 @@ PlayerInitCaltrops(PLAYERp pp)
nx, ny, nz, pp->angle.ang.asbuild(), (CHEMBOMB_VELOCITY + RANDOM_RANGE(CHEMBOMB_VELOCITY)) / 2);
wp = &sprite[w];
wu = User[w];
wu = User[w].Data();
// don't throw it as far if crawling
if (TEST(pp->Flags, PF_CRAWLING))
@ -1885,7 +1885,7 @@ int
InitCaltrops(int16_t SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
USERp wu;
SPRITEp wp;
int nx, ny, nz;
@ -1904,7 +1904,7 @@ InitCaltrops(int16_t SpriteNum)
nx, ny, nz, sp->ang, CHEMBOMB_VELOCITY / 2);
wp = &sprite[w];
wu = User[w];
wu = User[w].Data();
SET(wu->Flags, SPR_XFLIP_TOGGLE);
@ -1936,7 +1936,7 @@ int
InitPhosphorus(int16_t SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
USERp wu;
SPRITEp wp;
int nx, ny, nz;
@ -1958,7 +1958,7 @@ InitPhosphorus(int16_t SpriteNum)
nx, ny, nz, daang, CHEMBOMB_VELOCITY/3);
wp = &sprite[w];
wu = User[w];
wu = User[w].Data();
wp->hitag = LUMINOUS; // Always full brightness
SET(wu->Flags, SPR_XFLIP_TOGGLE);
@ -1995,7 +1995,7 @@ int
InitBloodSpray(int16_t SpriteNum, bool dogib, short velocity)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
USERp wu;
SPRITEp wp;
int nx, ny, nz;
@ -2047,7 +2047,7 @@ InitBloodSpray(int16_t SpriteNum, bool dogib, short velocity)
nx, ny, nz, ang, vel*2);
wp = &sprite[w];
wu = User[w];
wu = User[w].Data();
SET(wu->Flags, SPR_XFLIP_TOGGLE);
if (dogib)
@ -2174,11 +2174,11 @@ int
DoCarryFlag(int16_t Weapon)
{
SPRITEp sp = &sprite[Weapon];
USERp u = User[Weapon];
USERp u = User[Weapon].Data();
#define FLAG_DETONATE_STATE 99
SPRITEp fp = &sprite[u->FlagOwner];
USERp fu = User[u->FlagOwner];
USERp fu = User[u->FlagOwner].Data();
// if no owner then die
@ -2214,7 +2214,7 @@ DoCarryFlag(int16_t Weapon)
if (u->Counter2 < FLAG_DETONATE_STATE)
{
SPRITEp ap = &sprite[u->Attach];
USERp au = User[u->Attach];
USERp au = User[u->Attach].Data();
if (!au || au->Health <= 0)
{
@ -2329,11 +2329,11 @@ int
DoCarryFlagNoDet(int16_t Weapon)
{
SPRITEp sp = &sprite[Weapon];
USERp u = User[Weapon];
USERp u = User[Weapon].Data();
SPRITEp ap = &sprite[u->Attach];
USERp au = User[u->Attach];
USERp au = User[u->Attach].Data();
SPRITEp fp = &sprite[u->FlagOwner];
USERp fu = User[u->FlagOwner];
USERp fu = User[u->FlagOwner].Data();
if (u->FlagOwner >= 0)
@ -2397,7 +2397,7 @@ int
SetCarryFlag(int16_t Weapon)
{
SPRITEp sp = &sprite[Weapon];
USERp u = User[Weapon];
USERp u = User[Weapon].Data();
// stuck
SET(u->Flags, SPR_BOUNCE);
@ -2419,7 +2419,7 @@ int
DoFlag(int16_t Weapon)
{
SPRITEp sp = &sprite[Weapon];
USERp u = User[Weapon];
USERp u = User[Weapon].Data();
int16_t hit_sprite = -1;
hit_sprite = DoFlagRangeTest(Weapon, 1000);
@ -2448,7 +2448,7 @@ DoFlag(int16_t Weapon)
int
InitShell(int16_t SpriteNum, int16_t ShellNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
USERp wu;
SPRITEp sp = &sprite[SpriteNum], wp;
int nx, ny, nz;
@ -2484,7 +2484,7 @@ InitShell(int16_t SpriteNum, int16_t ShellNum)
nx, ny, nz, sp->ang, 64);
wp = &sprite[w];
wu = User[w];
wu = User[w].Data();
wp->zvel = -(velocity);

View file

@ -460,12 +460,12 @@ SetupLava(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,LAVA_RUN_R0,s_LavaRun[0]);
u = SpawnUser(SpriteNum,LAVA_RUN_R0,s_LavaRun[0]);
u->Health = 100;
}
@ -487,7 +487,7 @@ SetupLava(short SpriteNum)
int NullLava(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
@ -500,7 +500,7 @@ int NullLava(short SpriteNum)
int DoLavaMove(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);

View file

@ -78,7 +78,7 @@ void SectorLightShade(SPRITEp sp, short intensity)
// change wall
if (!TEST_BOOL4(sp))
{
ASSERT(User[sp - sprite] && User[sp - sprite]->WallShade.Data());
ASSERT(User[sp - sprite].Data() && User[sp - sprite]->WallShade.Data());
wall_shade = User[sp - sprite]->WallShade.Data();
startwall = sector[sp->sectnum].wallptr;

View file

@ -119,12 +119,12 @@ SetupToiletGirl(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,TOILETGIRL_R0,s_ToiletGirlStand);
u = SpawnUser(SpriteNum,TOILETGIRL_R0,s_ToiletGirlStand);
u->Health = 60;
}
@ -151,7 +151,7 @@ SetupToiletGirl(short SpriteNum)
int DoToiletGirl(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -209,7 +209,7 @@ int DoToiletGirl(short SpriteNum)
int NullToiletGirl(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -241,7 +241,7 @@ int NullToiletGirl(short SpriteNum)
int ToiletGirlUzi(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (!TEST(u->Flags,SPR_CLIMBING))
KeepActorOnFloor(SpriteNum);
@ -258,7 +258,7 @@ int ToiletGirlUzi(short SpriteNum)
int ToiletGirlPain(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
NullToiletGirl(SpriteNum);
@ -359,12 +359,12 @@ SetupWashGirl(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,WASHGIRL_R0,s_WashGirlStand);
u = SpawnUser(SpriteNum,WASHGIRL_R0,s_WashGirlStand);
u->Health = 60;
}
@ -390,7 +390,7 @@ SetupWashGirl(short SpriteNum)
int DoWashGirl(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -454,7 +454,7 @@ int DoWashGirl(short SpriteNum)
int NullWashGirl(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -486,7 +486,7 @@ int NullWashGirl(short SpriteNum)
int WashGirlUzi(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (!TEST(u->Flags,SPR_CLIMBING))
KeepActorOnFloor(SpriteNum);
@ -503,7 +503,7 @@ int WashGirlUzi(short SpriteNum)
int WashGirlPain(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
NullWashGirl(SpriteNum);
@ -568,12 +568,12 @@ SetupTrashCan(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,TRASHCAN,s_TrashCanStand);
u = SpawnUser(SpriteNum,TRASHCAN,s_TrashCanStand);
u->Health = 60;
}
@ -599,7 +599,7 @@ SetupTrashCan(short SpriteNum)
int DoTrashCan(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
//(*u->ActorActionFunc) (SpriteNum);
@ -620,7 +620,7 @@ int DoTrashCan(short SpriteNum)
int TrashCanPain(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
@ -676,12 +676,12 @@ SetupPachinkoLight(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,PACHINKOLIGHT_R0,s_PachinkoLightStand);
u = SpawnUser(SpriteNum,PACHINKOLIGHT_R0,s_PachinkoLightStand);
u->Health = 1;
}
@ -708,7 +708,7 @@ SetupPachinkoLight(short SpriteNum)
int PachinkoLightOperate(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
{
@ -777,12 +777,12 @@ SetupPachinko1(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,PACHINKO1,s_Pachinko1Stand);
u = SpawnUser(SpriteNum,PACHINKO1,s_Pachinko1Stand);
u->Health = 1;
}
@ -807,7 +807,7 @@ SetupPachinko1(short SpriteNum)
int PachinkoCheckWin(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
u->WaitTics = 0; // Can operate it again now
@ -840,7 +840,7 @@ int PachinkoCheckWin(short SpriteNum)
while ((i = it.NextIndex()) >= 0)
{
tsp = &sprite[i];
tu = User[i];
tu = User[i].Data();
if (tsp->lotag == TAG_PACHINKOLIGHT)
{
@ -947,12 +947,12 @@ SetupPachinko2(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,PACHINKO2,s_Pachinko2Stand);
u = SpawnUser(SpriteNum,PACHINKO2,s_Pachinko2Stand);
u->Health = 1;
}
@ -1031,12 +1031,12 @@ SetupPachinko3(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,PACHINKO3,s_Pachinko3Stand);
u = SpawnUser(SpriteNum,PACHINKO3,s_Pachinko3Stand);
u->Health = 1;
}
@ -1116,12 +1116,12 @@ SetupPachinko4(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,PACHINKO4,s_Pachinko4Stand);
u = SpawnUser(SpriteNum,PACHINKO4,s_Pachinko4Stand);
u->Health = 1;
}
@ -1229,12 +1229,12 @@ SetupCarGirl(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,CARGIRL_R0,s_CarGirlStand);
u = SpawnUser(SpriteNum,CARGIRL_R0,s_CarGirlStand);
u->Health = 60;
}
@ -1262,7 +1262,7 @@ SetupCarGirl(short SpriteNum)
int DoCarGirl(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -1311,7 +1311,7 @@ int DoCarGirl(short SpriteNum)
int NullCarGirl(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -1350,7 +1350,7 @@ int NullCarGirl(short SpriteNum)
int CarGirlUzi(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (!TEST(u->Flags,SPR_CLIMBING))
KeepActorOnFloor(SpriteNum);
@ -1367,7 +1367,7 @@ int CarGirlUzi(short SpriteNum)
int CarGirlPain(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
NullCarGirl(SpriteNum);
@ -1449,12 +1449,12 @@ SetupMechanicGirl(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,MECHANICGIRL_R0,s_MechanicGirlStand);
u = SpawnUser(SpriteNum,MECHANICGIRL_R0,s_MechanicGirlStand);
u->Health = 60;
}
@ -1481,7 +1481,7 @@ SetupMechanicGirl(short SpriteNum)
int DoMechanicGirl(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -1530,7 +1530,7 @@ int DoMechanicGirl(short SpriteNum)
int NullMechanicGirl(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -1569,7 +1569,7 @@ int NullMechanicGirl(short SpriteNum)
int MechanicGirlDrill(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (!TEST(u->Flags,SPR_CLIMBING))
KeepActorOnFloor(SpriteNum);
@ -1586,7 +1586,7 @@ int MechanicGirlDrill(short SpriteNum)
int MechanicGirlPain(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
NullMechanicGirl(SpriteNum);
@ -1668,12 +1668,12 @@ SetupSailorGirl(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,SAILORGIRL_R0,s_SailorGirlStand);
u = SpawnUser(SpriteNum,SAILORGIRL_R0,s_SailorGirlStand);
u->Health = 60;
}
@ -1701,7 +1701,7 @@ SetupSailorGirl(short SpriteNum)
int DoSailorGirl(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -1754,7 +1754,7 @@ int DoSailorGirl(short SpriteNum)
int NullSailorGirl(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
static short alreadythrew = 0;
@ -1798,7 +1798,7 @@ int NullSailorGirl(short SpriteNum)
int SailorGirlThrow(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (!TEST(u->Flags,SPR_CLIMBING))
KeepActorOnFloor(SpriteNum);
@ -1815,7 +1815,7 @@ int SailorGirlThrow(short SpriteNum)
int SailorGirlPain(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
NullSailorGirl(SpriteNum);
@ -1881,12 +1881,12 @@ SetupPruneGirl(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,PRUNEGIRL_R0,s_PruneGirlStand);
u = SpawnUser(SpriteNum,PRUNEGIRL_R0,s_PruneGirlStand);
u->Health = 60;
}
@ -1913,7 +1913,7 @@ SetupPruneGirl(short SpriteNum)
int DoPruneGirl(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -1978,7 +1978,7 @@ int DoPruneGirl(short SpriteNum)
int NullPruneGirl(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
bool ICanSee = false;
@ -2016,7 +2016,7 @@ int NullPruneGirl(short SpriteNum)
int PruneGirlUzi(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (!TEST(u->Flags,SPR_CLIMBING))
KeepActorOnFloor(SpriteNum);
@ -2033,7 +2033,7 @@ int PruneGirlUzi(short SpriteNum)
int PruneGirlPain(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
NullPruneGirl(SpriteNum);

View file

@ -1814,7 +1814,7 @@ int
DoHariKariBlood(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
return 0;
}
@ -1834,12 +1834,12 @@ SetupNinja(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum, NINJA_RUN_R0, s_NinjaRun[0]);
u = SpawnUser(SpriteNum, NINJA_RUN_R0, s_NinjaRun[0]);
u->Health = HEALTH_NINJA;
}
@ -1945,7 +1945,7 @@ SetupNinja(short SpriteNum)
int
DoNinjaHariKari(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
short cnt,i;
@ -1975,7 +1975,7 @@ DoNinjaHariKari(short SpriteNum)
int
DoNinjaGrabThroat(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
if ((u->WaitTics -= ACTORMOVETICS) <= 0)
@ -2015,7 +2015,7 @@ DoNinjaGrabThroat(short SpriteNum)
int
DoNinjaMove(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags2, SPR2_DYING))
{
@ -2062,7 +2062,7 @@ DoNinjaMove(short SpriteNum)
int
NinjaJumpActionFunc(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
int nx, ny;
@ -2094,7 +2094,7 @@ NinjaJumpActionFunc(short SpriteNum)
int
NullNinja(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (u->WaitTics > 0) u->WaitTics -= ACTORMOVETICS;
@ -2112,7 +2112,7 @@ NullNinja(short SpriteNum)
int DoNinjaPain(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
NullNinja(SpriteNum);
@ -2134,7 +2134,7 @@ int DoNinjaPain(short SpriteNum)
int DoNinjaSpecial(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (u->spal == PALETTE_PLAYER5)
{
@ -2156,7 +2156,7 @@ int CheckFire(short SpriteNum)
int
DoNinjaCeiling(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
DoActorSectorDamage(SpriteNum);
@ -2186,7 +2186,7 @@ void
PlayerLevelReset(PLAYERp pp)
{
SPRITEp sp = &sprite[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
if (gNet.MultiGameType == MULTI_GAME_COMMBAT)
{
@ -2227,7 +2227,7 @@ void
PlayerDeathReset(PLAYERp pp)
{
SPRITEp sp = &sprite[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
if (TEST(pp->Flags, PF_DIVING))
DoPlayerStopDiveNoWarp(pp);
@ -2304,7 +2304,7 @@ PlayerPanelSetup(void)
{
pp = Player + pnum;
u = User[pp->PlayerSprite];
u = User[pp->PlayerSprite].Data();
ASSERT(u != NULL);
@ -2319,7 +2319,7 @@ void
PlayerGameReset(PLAYERp pp)
{
SPRITEp sp = &sprite[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
COVER_SetReverb(0); // Turn off any echoing that may have been going before
pp->Reverb = 0;
@ -2379,7 +2379,7 @@ extern ACTOR_ACTION_SET PlayerNinjaActionSet;
void
PlayerSpriteLoadLevel(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
ChangeState(SpriteNum, s_NinjaRun[0]);
u->Rot = sg_NinjaRun;
@ -2407,7 +2407,7 @@ InitPlayerSprite(PLAYERp pp)
SET(sp->extra, SPRX_PLAYER_OR_ENEMY);
RESET(sp->cstat, CSTAT_SPRITE_TRANSLUCENT);
u = User[sp_num];
u = User[sp_num].Data();
// Grouping items that need to be reset after a LoadLevel
ChangeState(sp_num, s_NinjaRun[0]);
@ -2465,7 +2465,7 @@ InitPlayerSprite(PLAYERp pp)
void
SpawnPlayerUnderSprite(PLAYERp pp)
{
USERp pu = User[pp->PlayerSprite], u;
USERp pu = User[pp->PlayerSprite].Data(), u;
SPRITEp psp = &sprite[pp->PlayerSprite];
SPRITEp sp;
int pnum = pp - Player, sp_num;
@ -2474,7 +2474,7 @@ SpawnPlayerUnderSprite(PLAYERp pp)
NINJA_RUN_R0, NULL, pp->cursectnum, pp->posx, pp->posy, pp->posz, pp->angle.ang.asbuild(), 0);
sp = &sprite[sp_num];
u = User[sp_num];
u = User[sp_num].Data();
pp->UnderSpriteP = sp;

View file

@ -221,7 +221,7 @@ void ArmorCalc(int damage_amt, int *armor_damage, int *player_damage)
void PlayerUpdateHealth(PLAYERp pp, short value)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
short x,y;
if (Prediction)
@ -328,7 +328,7 @@ void PlayerUpdateHealth(PLAYERp pp, short value)
void PlayerUpdateAmmo(PLAYERp pp, short UpdateWeaponNum, short value)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
short x,y;
short WeaponNum;
@ -367,7 +367,7 @@ void PlayerUpdateAmmo(PLAYERp pp, short UpdateWeaponNum, short value)
void PlayerUpdateWeapon(PLAYERp pp, short WeaponNum)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
// Weapon Change
if (Prediction)
@ -434,7 +434,7 @@ int WeaponOperate(PLAYERp pp)
{
short weapon;
int DoPlayerSpriteReset(short SpriteNum);
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
InventoryKeys(pp);
@ -661,7 +661,7 @@ WeaponOK(PLAYERp pp)
if ((unsigned)pp->PlayerSprite >= MAXSPRITES)
return(false);
u = User[pp->PlayerSprite];
u = User[pp->PlayerSprite].Data();
if (u == NULL)
return(false);
@ -6887,7 +6887,7 @@ bool DrawBeforeView = false;
void
pDisplaySprites(PLAYERp pp, double smoothratio)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
PANEL_SPRITEp psp=NULL, next=NULL;
short shade, picnum, overlay_shade = 0;
double x, y;

View file

@ -1078,7 +1078,7 @@ DoPlayerSpriteThrow(PLAYERp pp)
int
DoPlayerSpriteReset(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
PLAYERp pp;
if (!u->PlayerP)
@ -1146,7 +1146,7 @@ DoPickTarget(SPRITEp sp, uint32_t max_delta_ang, int skip_targets)
SPRITEp ep;
USERp eu;
int16_t* shp;
USERp u = User[sp - sprite];
USERp u = User[sp - sprite].Data();
int ezh, ezhl, ezhm;
unsigned ndx;
TARGET_SORTp ts;
@ -1164,7 +1164,7 @@ DoPickTarget(SPRITEp sp, uint32_t max_delta_ang, int skip_targets)
while ((i = it.NextIndex()) >= 0)
{
ep = &sprite[i];
eu = User[i];
eu = User[i].Data();
// don't pick yourself
if (i == (sp - sprite))
@ -1274,7 +1274,7 @@ DoPlayerResetMovement(PLAYERp pp)
void
DoPlayerTeleportPause(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
// SPRITEp sp = pp->SpriteP;
// set this so we don't get stuck in teleporting loop
@ -1381,7 +1381,7 @@ DoSpawnTeleporterEffectPlace(SPRITEp sp)
void
DoPlayerWarpTeleporter(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
SPRITEp sp = pp->SpriteP;
short pnum;
SPRITEp sp_warp;
@ -1758,7 +1758,7 @@ void
UpdatePlayerUnderSprite(PLAYERp pp)
{
SPRITEp over_sp = pp->SpriteP;
USERp over_u = User[pp->PlayerSprite];
USERp over_u = User[pp->PlayerSprite].Data();
SPRITEp sp;
USERp u;
@ -1804,7 +1804,7 @@ UpdatePlayerUnderSprite(PLAYERp pp)
}
sp = pp->UnderSpriteP;
u = User[pp->PlayerUnderSprite];
u = User[pp->PlayerUnderSprite].Data();
SpriteNum = pp->PlayerUnderSprite;
@ -1974,7 +1974,7 @@ DoPlayerZrange(PLAYERp pp)
void
DoPlayerSlide(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
int push_ret;
if ((pp->slide_xvect|pp->slide_yvect) == 0)
@ -2067,7 +2067,7 @@ void PlayerSectorBound(PLAYERp pp, int amt)
void
DoPlayerMove(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
int friction;
int save_cstat;
int push_ret = 0;
@ -2583,7 +2583,7 @@ DriveCrush(PLAYERp pp, int *x, int *y)
while ((i = it.NextIndex()) >= 0)
{
sp = &sprite[i];
u = User[i];
u = User[i].Data();
if (testpointinquad(sp->x, sp->y, x, y))
{
@ -2670,7 +2670,7 @@ DriveCrush(PLAYERp pp, int *x, int *y)
continue;
sp = &sprite[i];
u = User[i];
u = User[i].Data();
if (u->PlayerP == pp)
continue;
@ -2699,7 +2699,7 @@ DriveCrush(PLAYERp pp, int *x, int *y)
while ((i = it.NextIndex()) >= 0)
{
sp = &sprite[i];
u = User[i];
u = User[i].Data();
// give some extra buffer
if (sp->z < sop->crush_z + Z(40))
@ -2726,7 +2726,7 @@ DoPlayerMoveVehicle(PLAYERp pp)
int floor_dist;
short save_sectnum;
SPRITEp sp = pp->sop->sp_child;
USERp u = User[sp - sprite];
USERp u = User[sp - sprite].Data();
int save_cstat;
int x[4], y[4], ox[4], oy[4];
int wallcount;
@ -2974,7 +2974,7 @@ DoPlayerMoveTurret(PLAYERp pp)
void
DoPlayerBeginJump(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
SET(pp->Flags, PF_JUMPING);
RESET(pp->Flags, PF_FALLING);
@ -3005,7 +3005,7 @@ DoPlayerBeginJump(PLAYERp pp)
void
DoPlayerBeginForceJump(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
SET(pp->Flags, PF_JUMPING);
RESET(pp->Flags, PF_FALLING|PF_CRAWLING|PF_CLIMBING|PF_LOCK_CRAWL);
@ -3153,7 +3153,7 @@ DoPlayerForceJump(PLAYERp pp)
void
DoPlayerBeginFall(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
SET(pp->Flags, PF_FALLING);
RESET(pp->Flags, PF_JUMPING);
@ -3299,7 +3299,7 @@ DoPlayerFall(PLAYERp pp)
}
else if (pp->jump_speed >= 4000)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
PlayerUpdateHealth(pp, -u->Health); // Make sure he dies!
u->Health = 0;
}
@ -3348,7 +3348,7 @@ DoPlayerFall(PLAYERp pp)
void
DoPlayerBeginClimb(PLAYERp pp)
{
// USERp u = User[pp->PlayerSprite];
// USERp u = User[pp->PlayerSprite].Data();
SPRITEp sp = pp->SpriteP;
RESET(pp->Flags, PF_JUMPING|PF_FALLING);
@ -3370,7 +3370,7 @@ DoPlayerBeginClimb(PLAYERp pp)
void
DoPlayerClimb(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
int climb_amt;
char i;
SPRITEp sp = pp->SpriteP;
@ -3647,7 +3647,7 @@ bool PlayerFlyKey(void)
void
DoPlayerBeginCrawl(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
RESET(pp->Flags, PF_FALLING | PF_JUMPING);
SET(pp->Flags, PF_CRAWLING);
@ -3687,7 +3687,7 @@ bool PlayerFallTest(PLAYERp pp, int player_height)
void
DoPlayerCrawl(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
if (pp->cursectnum >= 0 && SectorIsUnderwaterArea(pp->cursectnum))
{
@ -3763,7 +3763,7 @@ DoPlayerCrawl(PLAYERp pp)
void
DoPlayerBeginFly(PLAYERp pp)
{
// USERp u = User[pp->PlayerSprite];
// USERp u = User[pp->PlayerSprite].Data();
RESET(pp->Flags, PF_FALLING | PF_JUMPING | PF_CRAWLING);
SET(pp->Flags, PF_FLYING);
@ -4267,7 +4267,7 @@ GetOverlapSector2(int x, int y, short *over, short *under)
void
DoPlayerWarpToUnderwater(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
int i;
SECT_USERp sectu = SectUser[pp->cursectnum];
SPRITEp under_sp = NULL, over_sp = NULL;
@ -4344,7 +4344,7 @@ DoPlayerWarpToUnderwater(PLAYERp pp)
void
DoPlayerWarpToSurface(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
int i;
SECT_USERp sectu = SectUser[pp->cursectnum];
short over, under;
@ -4449,7 +4449,7 @@ void
DoPlayerBeginDive(PLAYERp pp)
{
SPRITEp sp = &sprite[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
if (Prediction)
return;
@ -4497,7 +4497,7 @@ DoPlayerBeginDive(PLAYERp pp)
void DoPlayerBeginDiveNoWarp(PLAYERp pp)
{
SPRITEp sp = &sprite[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
if (Prediction)
return;
@ -4644,7 +4644,7 @@ DoPlayerDiveMeter(PLAYERp pp)
void
DoPlayerDive(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
SECT_USERp sectu = SectUser[pp->cursectnum];
// whenever your view is not in a water area
@ -4827,7 +4827,7 @@ DoPlayerDive(PLAYERp pp)
int
DoPlayerTestPlaxDeath(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
// landed on a paralax floor
if (pp->lo_sectp && TEST(pp->lo_sectp->floorstat, FLOOR_STAT_PLAX))
@ -4858,7 +4858,7 @@ DoPlayerCurrent(PLAYERp pp)
{
if (!TEST(pp->Flags, PF_DEAD))
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
PlayerUpdateHealth(pp, -u->Health); // Make sure he dies!
PlayerCheckDeath(pp, -1);
@ -4875,7 +4875,7 @@ DoPlayerCurrent(PLAYERp pp)
{
if (!TEST(pp->Flags, PF_DEAD))
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
PlayerUpdateHealth(pp, -u->Health); // Make sure he dies!
PlayerCheckDeath(pp, -1);
@ -4890,7 +4890,7 @@ DoPlayerCurrent(PLAYERp pp)
void
DoPlayerFireOutWater(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
if (Prediction)
return;
@ -4906,7 +4906,7 @@ DoPlayerFireOutWater(PLAYERp pp)
void
DoPlayerFireOutDeath(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
if (Prediction)
return;
@ -4920,7 +4920,7 @@ DoPlayerFireOutDeath(PLAYERp pp)
void
DoPlayerBeginWade(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
// landed on a paralax floor?
if (DoPlayerTestPlaxDeath(pp))
@ -4953,7 +4953,7 @@ DoPlayerBeginWade(PLAYERp pp)
void
DoPlayerWade(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
DoPlayerFireOutWater(pp);
@ -5094,7 +5094,7 @@ DoPlayerWade(PLAYERp pp)
void
DoPlayerBeginOperateBoat(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
pp->floor_dist = PLAYER_RUN_FLOOR_DIST;
pp->ceiling_dist = PLAYER_RUN_CEILING_DIST;
@ -5115,7 +5115,7 @@ DoPlayerBeginOperateBoat(PLAYERp pp)
void
DoPlayerBeginOperateVehicle(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
pp->floor_dist = PLAYER_RUN_FLOOR_DIST;
pp->ceiling_dist = PLAYER_RUN_CEILING_DIST;
@ -5135,7 +5135,7 @@ DoPlayerBeginOperateVehicle(PLAYERp pp)
void
DoPlayerBeginOperateTurret(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
pp->floor_dist = PLAYER_RUN_FLOOR_DIST;
pp->ceiling_dist = PLAYER_RUN_CEILING_DIST;
@ -5816,7 +5816,7 @@ DoPlayerBeginDie(PLAYERp pp)
short bak;
int choosesnd = 0;
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
static void (*PlayerDeathFunc[MAX_PLAYER_DEATHS]) (PLAYERp) =
{
@ -5861,7 +5861,7 @@ DoPlayerBeginDie(PLAYERp pp)
// Give kill credit to player if necessary
if (pp->Killer >= 0)
{
USERp ku = User[pp->Killer];
USERp ku = User[pp->Killer].Data();
ASSERT(ku);
@ -6057,7 +6057,7 @@ DoPlayerDeathTilt(PLAYERp pp, short target, short speed)
void
DoPlayerDeathZrange(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
// make sure we don't land on a regular sprite
DoFindGround(pp->PlayerSprite);
@ -6134,7 +6134,7 @@ void DoPlayerDeathFollowKiller(PLAYERp pp)
void DoPlayerDeathCheckKeys(PLAYERp pp)
{
SPRITEp sp = pp->SpriteP;
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
if (pp->input.actions & SB_OPEN)
{
@ -6230,7 +6230,7 @@ DoPlayerHeadDebris(PLAYERp pp)
SPRITEp DoPlayerDeathCheckKick(PLAYERp pp)
{
SPRITEp sp = pp->SpriteP, hp;
USERp u = User[pp->PlayerSprite], hu;
USERp u = User[pp->PlayerSprite].Data(), hu;
int i;
unsigned stat;
int dist;
@ -6242,7 +6242,7 @@ SPRITEp DoPlayerDeathCheckKick(PLAYERp pp)
while ((i = it.NextIndex()) >= 0)
{
hp = &sprite[i];
hu = User[i];
hu = User[i].Data();
if (i == pp->PlayerSprite)
break;
@ -6293,7 +6293,7 @@ SPRITEp DoPlayerDeathCheckKick(PLAYERp pp)
void DoPlayerDeathMoveHead(PLAYERp pp)
{
SPRITEp sp = pp->SpriteP;
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
int dax,day;
short sectnum;
@ -6445,7 +6445,7 @@ void DoPlayerDeathDrown(PLAYERp pp)
void DoPlayerDeathBounce(PLAYERp pp)
{
SPRITEp sp = pp->SpriteP;
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
if (Prediction)
return;
@ -6475,7 +6475,7 @@ void DoPlayerDeathBounce(PLAYERp pp)
void DoPlayerDeathCrumble(PLAYERp pp)
{
SPRITEp sp = pp->SpriteP;
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
if (Prediction)
return;
@ -6528,7 +6528,7 @@ void DoPlayerDeathCrumble(PLAYERp pp)
void DoPlayerDeathExplode(PLAYERp pp)
{
SPRITEp sp = pp->SpriteP;
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
if (Prediction)
return;
@ -6584,7 +6584,7 @@ void DoPlayerDeathExplode(PLAYERp pp)
void
DoPlayerBeginRun(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
// Crawl if in small aread automatically
if (DoPlayerTestCrawl(pp))
@ -6619,7 +6619,7 @@ DoPlayerBeginRun(PLAYERp pp)
void
DoPlayerRun(PLAYERp pp)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
if (pp->cursectnum >= 0 && SectorIsUnderwaterArea(pp->cursectnum))
{
@ -6768,7 +6768,7 @@ PlayerStateControl(int16_t SpriteNum)
return;
// Convienience var
u = User[SpriteNum];
u = User[SpriteNum].Data();
if (u == NULL)
return;
@ -6859,7 +6859,7 @@ MoveSkipSavePos(void)
continue;
sp = &sprite[i];
u = User[i];
u = User[i].Data();
if (sp == NULL || u == NULL)
continue;
@ -6883,7 +6883,7 @@ MoveSkipSavePos(void)
if ((unsigned)i >= MAXSPRITES)
continue;
sp = &sprite[i];
u = User[i];
u = User[i].Data();
if (sp == NULL || u == NULL)
continue;
@ -7438,7 +7438,7 @@ InitMultiPlayerInfo(void)
start0 = SpawnSprite(MultiStatList[stat], ST1, NULL, pp->cursectnum, pp->posx, pp->posy, pp->posz, pp->angle.ang.asbuild(), 0);
ASSERT(start0 >= 0);
FreeUser(start0);
User[start0].Clear();
sprite[start0].picnum = ST1;
}
@ -7473,7 +7473,7 @@ InitMultiPlayerInfo(void)
int
DoFootPrints(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (u->PlayerP)
{

View file

@ -824,12 +824,12 @@ SetupRipper(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum, RIPPER_RUN_R0, s_RipperRun[0]);
u = SpawnUser(SpriteNum, RIPPER_RUN_R0, s_RipperRun[0]);
u->Health = HEALTH_RIPPER/2; // Baby rippers are weaker
}
@ -882,7 +882,7 @@ GetJumpHeight(short jump_speed, short jump_grav)
int
PickJumpSpeed(short SpriteNum, int pix_height)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
//ASSERT(pix_height < 128);
@ -907,7 +907,7 @@ int
PickJumpMaxSpeed(short SpriteNum, short max_speed)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int zh;
ASSERT(max_speed < 0);
@ -940,7 +940,7 @@ int
InitRipperHang(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int dist;
hitdata_t hitinfo = { { 0, 0, 0 }, -2, 0, -2 };
@ -1001,7 +1001,7 @@ InitRipperHang(short SpriteNum)
int
DoRipperHang(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if ((u->WaitTics -= ACTORMOVETICS) > 0)
return 0;
@ -1016,7 +1016,7 @@ int
DoRipperMoveHang(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int nx, ny;
// Move while jumping
@ -1055,7 +1055,7 @@ DoRipperMoveHang(short SpriteNum)
int
DoRipperHangJF(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
@ -1087,7 +1087,7 @@ int
DoRipperBeginJumpAttack(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp psp = User[SpriteNum]->tgt_sp;
short tang;
@ -1121,7 +1121,7 @@ DoRipperBeginJumpAttack(short SpriteNum)
int
DoRipperMoveJump(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
@ -1150,7 +1150,7 @@ DoRipperMoveJump(short SpriteNum)
int
DoRipperQuickJump(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
// Tests to see if ripper is on top of a player/enemy and then immediatly
// does another jump
@ -1175,7 +1175,7 @@ DoRipperQuickJump(short SpriteNum)
int
NullRipper(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
@ -1188,7 +1188,7 @@ NullRipper(short SpriteNum)
int DoRipperPain(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
NullRipper(SpriteNum);
@ -1204,7 +1204,7 @@ int DoRipperRipHeart(short SpriteNum)
// CTW MODIFICATION END
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp tsp = u->tgt_sp;
@ -1221,7 +1221,7 @@ int DoRipperRipHeart(short SpriteNum)
int DoRipperStandHeart(short SpriteNum)
// CTW MODIFICATION END
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
NullRipper(SpriteNum);
@ -1259,7 +1259,7 @@ void RipperHatch(short Weapon)
np->ang = rip_ang[i];
np->pal = 0;
SetupRipper(New);
nu = User[New];
nu = User[New].Data();
// make immediately active
SET(nu->Flags, SPR_ACTIVE);
@ -1284,7 +1284,7 @@ void RipperHatch(short Weapon)
int
DoRipperMove(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (u->scale_speed)
{

View file

@ -894,12 +894,12 @@ SetupRipper2(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum, RIPPER2_RUN_R0, s_Ripper2Run[0]);
u = SpawnUser(SpriteNum, RIPPER2_RUN_R0, s_Ripper2Run[0]);
u->Health = HEALTH_RIPPER2;
}
@ -940,7 +940,7 @@ int
InitRipper2Hang(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int dist;
hitdata_t hitinfo = { { 0, 0, 0 }, -2, 0, -2 };
@ -1000,7 +1000,7 @@ InitRipper2Hang(short SpriteNum)
int
DoRipper2Hang(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if ((u->WaitTics -= ACTORMOVETICS) > 0)
return 0;
@ -1016,7 +1016,7 @@ int
DoRipper2MoveHang(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int nx, ny;
// Move while jumping
@ -1062,7 +1062,7 @@ DoRipper2MoveHang(short SpriteNum)
int
DoRipper2HangJF(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
@ -1094,7 +1094,7 @@ int
DoRipper2BeginJumpAttack(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp psp = User[SpriteNum]->tgt_sp;
short tang;
@ -1135,7 +1135,7 @@ DoRipper2BeginJumpAttack(short SpriteNum)
int
DoRipper2MoveJump(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{
@ -1164,7 +1164,7 @@ DoRipper2MoveJump(short SpriteNum)
int
DoRipper2QuickJump(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
// Tests to see if ripper2 is on top of a player/enemy and then immediatly
// does another jump
@ -1189,7 +1189,7 @@ DoRipper2QuickJump(short SpriteNum)
int
NullRipper2(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
@ -1202,7 +1202,7 @@ NullRipper2(short SpriteNum)
int DoRipper2Pain(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
NullRipper2(SpriteNum);
@ -1215,7 +1215,7 @@ int DoRipper2Pain(short SpriteNum)
int DoRipper2RipHeart(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp tsp = u->tgt_sp;
@ -1230,7 +1230,7 @@ int DoRipper2RipHeart(short SpriteNum)
int DoRipper2StandHeart(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
NullRipper2(SpriteNum);
@ -1274,7 +1274,7 @@ void Ripper2Hatch(short Weapon)
np->pal = 0;
np->shade = -10;
SetupRipper2(New);
nu = User[New];
nu = User[New].Data();
// make immediately active
SET(nu->Flags, SPR_ACTIVE);
@ -1300,7 +1300,7 @@ int
DoRipper2Move(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (sp->hitag == TAG_SWARMSPOT && sp->lotag == 1)
DoCheckSwarm(SpriteNum);

View file

@ -47,7 +47,7 @@ void DoRotatorStopInterp(short SpriteNum);
void ReverseRotator(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
ROTATORp r;
r = u->rotator.Data();
@ -97,7 +97,7 @@ RotatorSwitch(short match, short setting)
void SetRotatorActive(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
ROTATORp r;
@ -120,7 +120,7 @@ void SetRotatorActive(short SpriteNum)
void SetRotatorInactive(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
DoRotatorStopInterp(SpriteNum);
@ -170,7 +170,7 @@ DoRotatorMatch(PLAYERp pp, short match, bool manual)
if (SP_TAG1(fsp) == SECT_ROTATOR && SP_TAG2(fsp) == match)
{
fu = User[i];
fu = User[i].Data();
// single play only vator
// bool 8 must be set for message to display
@ -247,7 +247,7 @@ TestRotatorMatchActive(short match)
if (SP_TAG1(fsp) == SECT_ROTATOR && SP_TAG2(fsp) == match)
{
fu = User[i];
fu = User[i].Data();
// Does not have to be inactive to be operated
if (TEST_BOOL6(fsp))
@ -310,7 +310,7 @@ void DoRotatorStopInterp(short SpriteNum)
int DoRotatorMove(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
ROTATORp r;
short ndx,w,startwall,endwall;
@ -435,7 +435,7 @@ int DoRotatorMove(short SpriteNum)
int DoRotator(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
// could move this inside sprite control

View file

@ -361,17 +361,17 @@ bool GameInterface::SaveGame()
for (i = 0; i < MAXSPRITES; i++)
{
ndx = i;
if (User[i])
if (User[i].Data())
{
// write header
MWRITE(&ndx,sizeof(ndx),1,fil);
#if 0
memcpy(&tu, User[i], sizeof(USER));
u = &tu;
MWRITE(u,sizeof(USER),1,fil);
#if 0
if (u->WallShade)
{
MWRITE(u->WallShade, sizeof(*u->WallShade) * u->WallCount, 1, fil);
@ -484,9 +484,9 @@ bool GameInterface::SaveGame()
// maintain compatibility with sinking boat which points to user data
for (j=0; j<MAXSPRITES; j++)
{
if (User[j])
if (User[j].Data())
{
uint8_t* bp = (uint8_t*)User[j];
uint8_t* bp = (uint8_t*)User[j].Data();
if ((uint8_t*)a->ptr >= bp && (uint8_t*)a->ptr < bp + sizeof(USER))
{
@ -748,7 +748,8 @@ bool GameInterface::LoadGame()
MREAD(&SpriteNum, sizeof(SpriteNum),1,fil);
while (SpriteNum != -1)
{
User[SpriteNum] = u = NewUser();
User[SpriteNum].Alloc();
u = User[SpriteNum].Data();
// We need to be careful with allocated content in User when loading a binary save state.
// This needs to be refactored out ASAP.
u->rotator.Clear();
@ -858,7 +859,7 @@ bool GameInterface::LoadGame()
int offset;
MREAD(&j, sizeof(j),1,fil);
MREAD(&offset, sizeof(offset),1,fil);
a->ptr = (int *)(((char *)User[j]) + offset);
a->ptr = (int *)(((char *)User[j].Data()) + offset);
}
else if ((intptr_t)a->ptr == -3)
{

View file

@ -367,7 +367,7 @@ private:
void PlayerUpdateWeaponSummary(PLAYERp pp, int UpdateWeaponNum)
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
int x, y;
int pos;
int column;
@ -665,7 +665,7 @@ private:
void DrawStatusBar()
{
auto pp = Player + screenpeek;
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
BeginStatusBar(320, 200, tileHeight(STATUS_BAR));
if (hud_size == Hud_StbarOverlay) Set43ClipRect();
@ -742,7 +742,7 @@ private:
{
BeginHUD(320, 200, 1);
auto pp = Player + screenpeek;
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
int x, y;
INVENTORY_DATAp id;
@ -785,7 +785,7 @@ private:
BeginHUD(320, 200, 1);
auto pp = Player + screenpeek;
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
FString format;
FGameTexture* img;

View file

@ -83,7 +83,7 @@ int lavaradx[32][128], lavarady[32][128], lavaradcnt[32];
#endif
SECT_USERp SectUser[MAXSECTORS];
USERp User[MAXSPRITES];
TPointer<USER> User[MAXSPRITES];
ANIM Anim[MAXANIM];
short AnimCnt = 0;
@ -1025,7 +1025,7 @@ void
SectorExp(short SpriteNum, short sectnum, short orig_ang, int zh)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
short explosion;
SPRITEp exp;
USERp eu;
@ -1053,7 +1053,7 @@ SectorExp(short SpriteNum, short sectnum, short orig_ang, int zh)
explosion = SpawnSectorExp(SpriteNum);
ASSERT(explosion >= 0);
exp = &sprite[explosion];
eu = User[explosion];
eu = User[explosion].Data();
exp->xrepeat += (RANDOM_P2(32<<8)>>8) - 16;
exp->yrepeat += (RANDOM_P2(32<<8)>>8) - 16;
@ -1082,7 +1082,7 @@ DoExplodeSector(short match)
if (match != esp->lotag)
continue;
if (!User[cf])
if (!User[cf].Data())
/*u = */SpawnUser(cf, 0, NULL);
sectp = &sector[esp->sectnum];
@ -1114,7 +1114,7 @@ DoExplodeSector(short match)
int DoSpawnSpot(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if ((u->WaitTics -= synctics) < 0)
{
@ -1150,7 +1150,7 @@ DoSpawnSpotsForKill(short match)
// change the stat num and set the delay correctly to call SpawnShrap
if (sp->hitag == SPAWN_SPOT && sp->lotag == match)
{
u = User[sn];
u = User[sn].Data();
change_sprite_stat(sn, STAT_NO_STATE);
u->ActorActionFunc = DoSpawnSpot;
u->WaitTics = SP_TAG5(sp) * 15;
@ -1181,7 +1181,7 @@ DoSpawnSpotsForDamage(short match)
if (sp->hitag == SPAWN_SPOT && sp->lotag == match)
{
u = User[sn];
u = User[sn].Data();
change_sprite_stat(sn, STAT_NO_STATE);
u->ActorActionFunc = DoSpawnSpot;
u->WaitTics = SP_TAG7(sp) * 15;
@ -1398,7 +1398,7 @@ WeaponExplodeSectorInRange(short weapon)
{
int i;
SPRITEp wp = &sprite[weapon];
USERp wu = User[weapon];
USERp wu = User[weapon].Data();
SPRITEp sp;
int dist;
int radius;
@ -1668,7 +1668,7 @@ int
OperateSprite(short SpriteNum, short player_is_operating)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
PLAYERp pp = NULL;
short state;
short key_num=0;
@ -1997,7 +1997,7 @@ int DoTrapReset(short match)
while ((i = it.NextIndex()) >= 0)
{
sp = &sprite[i];
u = User[i];
u = User[i].Data();
if (sp->lotag != match)
continue;
@ -2029,7 +2029,7 @@ int DoTrapMatch(short match)
while ((i = it.NextIndex()) >= 0)
{
sp = &sprite[i];
u = User[i];
u = User[i].Data();
if (sp->lotag != match)
continue;
@ -2161,7 +2161,7 @@ OperateTripTrigger(PLAYERp pp)
while ((i = it.NextIndex()) >= 0)
{
sp = &sprite[i];
u = User[i];
u = User[i].Data();
if (TEST(u->Flags, SPR_WAIT_FOR_TRIGGER))
{
@ -2235,7 +2235,7 @@ OperateContinuousTrigger(PLAYERp pp)
while ((i = it.NextIndex()) >= 0)
{
sp = &sprite[i];
u = User[i];
u = User[i].Data();
// if correct type and matches
if (sp->hitag == FIREBALL_TRAP && sp->lotag == sector[pp->cursectnum].hitag)
@ -2284,7 +2284,7 @@ OperateContinuousTrigger(PLAYERp pp)
short PlayerTakeSectorDamage(PLAYERp pp)
{
SECT_USERp sectu = SectUser[pp->cursectnum];
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
// the calling routine must make sure sectu exists
if ((u->DamageTics -= synctics) < 0)
@ -2711,7 +2711,7 @@ PlayerOperateEnv(PLAYERp pp)
}
else
{
USERp u = User[pp->PlayerSprite];
USERp u = User[pp->PlayerSprite].Data();
u->DamageTics = 0;
}

View file

@ -704,12 +704,12 @@ SetupSerp(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,SERP_RUN_R0,s_SerpRun[0]);
u = SpawnUser(SpriteNum,SERP_RUN_R0,s_SerpRun[0]);
u->Health = HEALTH_SERP_GOD;
}
@ -755,7 +755,7 @@ SetupSerp(short SpriteNum)
int NullSerp(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
@ -769,7 +769,7 @@ int NullSerp(short SpriteNum)
int DoSerpMove(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);

View file

@ -509,12 +509,12 @@ SetupSkel(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,SKEL_RUN_R0,s_SkelRun[0]);
u = SpawnUser(SpriteNum,SKEL_RUN_R0,s_SkelRun[0]);
u->Health = HEALTH_SKEL_PRIEST;
}
@ -588,7 +588,7 @@ int DoSkelTermTeleport(short SpriteNum)
int NullSkel(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);
@ -601,7 +601,7 @@ int NullSkel(short SpriteNum)
int DoSkelPain(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
NullSkel(SpriteNum);
@ -613,7 +613,7 @@ int DoSkelPain(short SpriteNum)
int DoSkelMove(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(SpriteNum);

View file

@ -219,12 +219,12 @@ SetupSkull(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,SKULL_R0,s_SkullWait[0]);
u = SpawnUser(SpriteNum,SKULL_R0,s_SkullWait[0]);
u->Health = HEALTH_SKULL;
}
@ -265,7 +265,7 @@ int
DoSkullMove(int16_t SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int32_t dax, day, daz;
dax = MOVEx(sp->xvel, sp->ang);
@ -282,7 +282,7 @@ int
DoSkullBeginDeath(int16_t SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int16_t i,num_ord=0;
//extern short *DamageRadiusSkull;
@ -369,7 +369,7 @@ DoSkullBeginDeath(int16_t SpriteNum)
int DoSkullJump(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (sp->xvel)
@ -432,7 +432,7 @@ int DoSkullJump(short SpriteNum)
int DoSkullBob(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
// actor does a sine wave about u->sz - this is the z mid point
#define SKULL_BOB_AMT (Z(16))
@ -457,7 +457,7 @@ int DoSkullSpawnShrap(short SpriteNum)
int DoSkullWait(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int a,b,c,dist;
DISTANCE(sp->x, sp->y, u->tgt_sp->x, u->tgt_sp->y, dist, a, b, c);
@ -637,12 +637,12 @@ SetupBetty(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,BETTY_R0,s_BettyWait[0]);
u = SpawnUser(SpriteNum,BETTY_R0,s_BettyWait[0]);
u->Health = HEALTH_SKULL;
}
@ -683,7 +683,7 @@ int
DoBettyMove(int16_t SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int32_t dax, day, daz;
dax = MOVEx(sp->xvel, sp->ang);
@ -700,7 +700,7 @@ int
DoBettyBeginDeath(int16_t SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int16_t i,num_ord=0;
//extern short *DamageRadiusBetty;
@ -782,7 +782,7 @@ DoBettyBeginDeath(int16_t SpriteNum)
int DoBettyJump(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (sp->xvel)
@ -843,7 +843,7 @@ int DoBettyJump(short SpriteNum)
int DoBettyBob(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
// actor does a sine wave about u->sz - this is the z mid point
#define BETTY_BOB_AMT (Z(16))
@ -866,7 +866,7 @@ int DoBettySpawnShrap(short SpriteNum)
int DoBettyWait(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int a,b,c,dist;
DISTANCE(sp->x, sp->y, u->tgt_sp->x, u->tgt_sp->y, dist, a, b, c);

View file

@ -41,7 +41,7 @@ BEGIN_SW_NS
void ReverseSlidor(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
ROTATORp r;
r = u->rotator.Data();
@ -92,7 +92,7 @@ SlidorSwitch(short match, short setting)
void SetSlidorActive(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
ROTATORp r;
@ -115,7 +115,7 @@ void SetSlidorActive(short SpriteNum)
void SetSlidorInactive(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
DoSlidorInterp(SpriteNum, StopInterpolation);
@ -166,7 +166,7 @@ DoSlidorMatch(PLAYERp pp, short match, bool manual)
if (SP_TAG1(fsp) == SECT_SLIDOR && SP_TAG2(fsp) == match)
{
fu = User[i];
fu = User[i].Data();
// single play only vator
// bool 8 must be set for message to display
@ -243,7 +243,7 @@ TestSlidorMatchActive(short match)
if (SP_TAG1(fsp) == SECT_SLIDOR && SP_TAG2(fsp) == match)
{
fu = User[i];
fu = User[i].Data();
// Does not have to be inactive to be operated
if (TEST_BOOL6(fsp))
@ -537,7 +537,7 @@ int DoSlidorInstantClose(short SpriteNum)
int DoSlidorMove(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
ROTATORp r;
int old_pos;
@ -632,7 +632,7 @@ int DoSlidorMove(short SpriteNum)
while ((i = it.NextIndex()) >= 0)
{
bsp = &sprite[i];
bu = User[i];
bu = User[i].Data();
if (bu && TEST(bsp->cstat, CSTAT_SPRITE_BLOCK) && TEST(bsp->extra, SPRX_PLAYER_OR_ENEMY))
{
@ -681,7 +681,7 @@ int DoSlidorMove(short SpriteNum)
int DoSlidor(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
SECTORp sectp = &sector[sp->sectnum];

View file

@ -788,7 +788,7 @@ void Set3DSoundOwner(short spritenum)
void PlaySpriteSound(short spritenum, int attrib_ndx, Voc3D_Flags flags)
{
SPRITEp sp = &sprite[spritenum];
USERp u = User[spritenum];
USERp u = User[spritenum].Data();
ASSERT(u);

View file

@ -43,7 +43,7 @@ void InterpSectorSprites(short sectnum, bool state);
void ReverseSpike(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
// if paused go ahead and start it up again
@ -97,7 +97,7 @@ SpikeSwitch(short match, short setting)
void SetSpikeActive(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
SECTORp sectp = &sector[sp->sectnum];
@ -125,7 +125,7 @@ void SetSpikeActive(short SpriteNum)
void SetSpikeInactive(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
SECTORp sectp = &sector[sp->sectnum];
@ -195,7 +195,7 @@ DoSpikeMatch(short match)
if (SP_TAG1(fsp) == SECT_SPIKE && SP_TAG2(fsp) == match)
{
fu = User[i];
fu = User[i].Data();
if (first_spike == -1)
first_spike = i;
@ -229,7 +229,7 @@ TestSpikeMatchActive(short match)
if (SP_TAG1(fsp) == SECT_SPIKE && SP_TAG2(fsp) == match)
{
fu = User[i];
fu = User[i].Data();
// door war
if (TEST_BOOL6(fsp))
@ -245,7 +245,7 @@ TestSpikeMatchActive(short match)
int DoSpikeMove(short SpriteNum, int *lptr)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int zval;
zval = *lptr;
@ -282,7 +282,7 @@ int DoSpikeMove(short SpriteNum, int *lptr)
void SpikeAlign(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
// either work on single sector or all tagged in SOBJ
@ -313,7 +313,7 @@ void MoveSpritesWithSpike(short sectnum)
{
sp = &sprite[i];
if (User[i])
if (User[i].Data())
continue;
if (TEST(sp->extra, SPRX_STAY_PUT_VATOR))
@ -326,7 +326,7 @@ void MoveSpritesWithSpike(short sectnum)
int DoSpike(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
int *lptr;
@ -409,7 +409,7 @@ int DoSpike(short SpriteNum)
while ((i = it.NextIndex()) >= 0)
{
bsp = &sprite[i];
bu = User[i];
bu = User[i].Data();
if (bu && TEST(bsp->cstat, CSTAT_SPRITE_BLOCK) && TEST(bsp->extra, SPRX_PLAYER_OR_ENEMY))
{
@ -444,7 +444,7 @@ int DoSpike(short SpriteNum)
int DoSpikeAuto(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
int *lptr;

View file

@ -593,7 +593,7 @@ SetOwner(short owner, short child)
if (owner >= 0)
{
ASSERT(User[owner]);
ASSERT(User[owner].Data());
SET(User[owner]->Flags2, SPR2_CHILDREN);
}
else
@ -608,11 +608,11 @@ SetOwner(short owner, short child)
void
SetAttach(short owner, short child)
{
USERp cu = User[child];
USERp cu = User[child].Data();
ASSERT(cu);
ASSERT(User[owner]);
ASSERT(User[owner].Data());
SET(User[owner]->Flags2, SPR2_CHILDREN);
cu->Attach = owner;
}
@ -621,7 +621,7 @@ void
KillSprite(int16_t SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int i;
unsigned stat;
short statnum,sectnum;
@ -727,7 +727,7 @@ KillSprite(int16_t SpriteNum)
StatIterator it(MissileStats[stat]);
while ((i = it.NextIndex()) >= 0)
{
mu = User[i];
mu = User[i].Data();
if (mu && mu->WpnGoal == SpriteNum)
{
@ -753,7 +753,7 @@ KillSprite(int16_t SpriteNum)
sprite[i].owner = -1;
}
if (User[i] && User[i]->Attach == SpriteNum)
if (User[i].Data() && User[i]->Attach == SpriteNum)
{
User[i]->Attach = -1;
}
@ -766,7 +766,7 @@ KillSprite(int16_t SpriteNum)
StatIterator it(STAT_ENEMY);
while ((i = it.NextIndex()) >= 0)
{
if ((unsigned)i < MAXSPRITES && User[i] != NULL && User[i]->tgt_sp == sp)
if ((unsigned)i < MAXSPRITES && User[i].Data() != NULL && User[i]->tgt_sp == sp)
{
DoActorPickClosePlayer(i);
}
@ -777,10 +777,7 @@ KillSprite(int16_t SpriteNum)
{
SetSuicide(u->flame);
}
u->rotator.Clear();
FreeUser(SpriteNum);
User[SpriteNum].Clear();
}
FVector3 pos = GetSoundPos(&sprite[SpriteNum].pos);
@ -795,9 +792,9 @@ KillSprite(int16_t SpriteNum)
sp->sectnum = sectnum;
// Kill references in all users - slow but unavoidable if we don't want the game to crash on stale pointers.
for (auto u : User)
for (auto& u : User)
{
if (u)
if (u.Data())
{
if (u->hi_sp == sp) u->hi_sp = nullptr;
if (u->lo_sp == sp) u->lo_sp = nullptr;
@ -808,7 +805,7 @@ KillSprite(int16_t SpriteNum)
void ChangeState(short SpriteNum, STATEp statep)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (u == nullptr)
return;
@ -821,7 +818,7 @@ void ChangeState(short SpriteNum, STATEp statep)
void
change_sprite_stat(short SpriteNum, short stat)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
changespritestat(SpriteNum, stat);
@ -873,7 +870,8 @@ SpawnUser(short SpriteNum, short id, STATEp state)
ASSERT(!Prediction);
User[SpriteNum] = u = NewUser();
User[SpriteNum].Alloc();
u = User[SpriteNum].Data();
PRODUCTION_ASSERT(u != NULL);
@ -970,7 +968,7 @@ SpawnSprite(short stat, short id, STATEp state, short sectnum, int x, int y, int
sp->z = z;
sp->cstat = 0;
User[SpriteNum] = u = SpawnUser(SpriteNum, id, state);
u = SpawnUser(SpriteNum, id, state);
// be careful State can be NULL
if (u->State)
@ -1560,7 +1558,7 @@ void
IconDefault(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
//if (sp->statnum == STAT_ITEM)
change_sprite_stat(SpriteNum, STAT_ITEM);
@ -1761,7 +1759,7 @@ SpriteSetupPost(void)
if (TEST(ds->cstat, CSTAT_SPRITE_ALIGNMENT_WALL|CSTAT_SPRITE_ALIGNMENT_FLOOR))
continue;
if (User[i])
if (User[i].Data())
continue;
getzsofslope(ds->sectnum, ds->x, ds->y, &cz, &fz);
@ -2593,7 +2591,7 @@ SpriteSetup(void)
}
}
User[SpriteNum] = u = SpawnUser(SpriteNum, 0, NULL);
u = SpawnUser(SpriteNum, 0, NULL);
u->WallShade.Resize(wallcount);
wall_shade = u->WallShade.Data();
@ -2649,7 +2647,7 @@ SpriteSetup(void)
// !LIGHT
// make an wall_shade array and put it in User
User[SpriteNum] = u = SpawnUser(SpriteNum, 0, NULL);
u = SpawnUser(SpriteNum, 0, NULL);
u->WallShade.Resize(wallcount);
wall_shade = u->WallShade.Data();
@ -2857,7 +2855,7 @@ SpriteSetup(void)
break;
case SPAWN_SPOT:
if (!User[SpriteNum])
if (!User[SpriteNum].Data())
u = SpawnUser(SpriteNum, ST1, NULL);
if (SP_TAG14(sp) == ((64<<8)|64))
@ -3828,7 +3826,7 @@ bool ItemSpotClear(SPRITEp sip, short statnum, short id)
void SetupItemForJump(SPRITEp sip, short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
// setup item for jumping
if (SP_TAG7(sip))
@ -3850,7 +3848,7 @@ void SetupItemForJump(SPRITEp sip, short SpriteNum)
int ActorCoughItem(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
short New,choose;
SPRITEp np;
@ -4357,7 +4355,7 @@ int SpawnItemsMatch(short match)
SpriteNum = SpawnSprite(STAT_ITEM, ICON_ARMOR, s_IconArmor, sip->sectnum, sip->x, sip->y, sip->z, sip->ang, 0);
sp = &sprite[SpriteNum];
u = User[SpriteNum];
u = User[SpriteNum].Data();
SET(u->Flags2, SPR2_NEVER_RESPAWN);
IconDefault(SpriteNum);
@ -4581,7 +4579,7 @@ int SpawnItemsMatch(short match)
break;
SpriteNum = SpawnSprite(STAT_ITEM, s_Key[num]->Pic, s_Key[num], sip->sectnum, sip->x, sip->y, sip->z, sip->ang, 0);
u = User[SpriteNum];
u = User[SpriteNum].Data();
sp = &sprite[SpriteNum];
@ -4617,7 +4615,7 @@ int
// CTW MODIFICATION END
NewStateGroup(short SpriteNum, STATEp StateGroup[])
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
//if (Prediction)
// return;
@ -4650,8 +4648,8 @@ SpriteOverlap(int16_t spritenum_a, int16_t spritenum_b)
{
SPRITEp spa = &sprite[spritenum_a], spb = &sprite[spritenum_b];
USERp ua = User[spritenum_a];
USERp ub = User[spritenum_b];
USERp ua = User[spritenum_a].Data();
USERp ub = User[spritenum_b].Data();
int spa_tos, spa_bos, spb_tos, spb_bos, overlap_z;
@ -4846,7 +4844,7 @@ void
DoActorZrange(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int ceilhit, florhit;
short save_cstat;
@ -4891,7 +4889,7 @@ DoActorZrange(short SpriteNum)
int
DoActorGlobZ(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
u->loz = globloz;
u->hiz = globhiz;
@ -5017,7 +5015,7 @@ DropAhead(short SpriteNum, short min_height)
int
move_actor(short SpriteNum, int xchange, int ychange, int zchange)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
int x, y, z, loz, hiz;
@ -5151,10 +5149,7 @@ DoGrating(short SpriteNum)
if (sp->hitag <= 0)
{
change_sprite_stat(SpriteNum, STAT_DEFAULT);
if (User[SpriteNum])
{
FreeUser(SpriteNum);
}
User[SpriteNum].Clear();
}
setspritez(SpriteNum, &sp->pos);
@ -5166,7 +5161,7 @@ DoGrating(short SpriteNum)
int
DoSpriteFade(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
short i;
@ -5196,7 +5191,7 @@ DoSpriteFade(short SpriteNum)
int
SpearOnFloor(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
if (!TEST(u->Flags, SPR_SO_ATTACHED))
@ -5214,7 +5209,7 @@ SpearOnFloor(short SpriteNum)
int
SpearOnCeiling(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
if (!TEST(u->Flags, SPR_SO_ATTACHED))
@ -5245,7 +5240,7 @@ DoKey(short SpriteNum)
int
DoCoin(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int offset;
u->WaitTics -= ACTORMOVETICS * 2;
@ -5281,7 +5276,7 @@ DoCoin(short SpriteNum)
int
KillGet(short SpriteNum)
{
USERp u = User[SpriteNum],nu;
USERp u = User[SpriteNum].Data(),nu;
SPRITEp sp = User[SpriteNum]->SpriteP,np;
short New;
@ -5312,7 +5307,7 @@ KillGet(short SpriteNum)
sp->x, sp->y, sp->z, 0, 0);
np = &sprite[New];
nu = User[New];
nu = User[New].Data();
np->shade = -20;
nu->WaitTics = u->WaitTics - 12;
@ -5325,7 +5320,7 @@ KillGet(short SpriteNum)
int
KillGetAmmo(short SpriteNum)
{
USERp u = User[SpriteNum],nu;
USERp u = User[SpriteNum].Data(),nu;
SPRITEp sp = User[SpriteNum]->SpriteP,np;
short New;
@ -5364,7 +5359,7 @@ KillGetAmmo(short SpriteNum)
sp->x, sp->y, sp->z, 0, 0);
np = &sprite[New];
nu = User[New];
nu = User[New].Data();
np->shade = -20;
nu->WaitTics = u->WaitTics - 12;
@ -5377,7 +5372,7 @@ KillGetAmmo(short SpriteNum)
int
KillGetWeapon(short SpriteNum)
{
USERp u = User[SpriteNum],nu;
USERp u = User[SpriteNum].Data(),nu;
SPRITEp sp = User[SpriteNum]->SpriteP,np;
short New;
@ -5424,7 +5419,7 @@ KillGetWeapon(short SpriteNum)
sp->x, sp->y, sp->z, 0, 0);
np = &sprite[New];
nu = User[New];
nu = User[New].Data();
np->shade = -20;
nu->WaitTics = u->WaitTics - 12;
@ -5467,7 +5462,7 @@ void ChoosePlayerGetSound(PLAYERp pp)
bool CanGetWeapon(PLAYERp pp, short SpriteNum, int WPN)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
switch (gNet.MultiGameType)
{
@ -5519,8 +5514,8 @@ struct InventoryDecl_t InventoryDecls[InvDecl_TOTAL] =
int
DoGet(short SpriteNum)
{
USERp u = User[SpriteNum], pu;
SPRITEp sp = User[SpriteNum]->SpriteP;
USERp u = User[SpriteNum].Data(), pu;
SPRITEp sp = u->SpriteP;
PLAYERp pp;
short pnum, key_num;
int dist, a,b,c;
@ -5561,8 +5556,8 @@ DoGet(short SpriteNum)
TRAVERSE_CONNECT(pnum)
{
pp = &Player[pnum];
//pu = User[pp->PlayerSprite];
pu = User[pp->SpriteP - sprite];
//pu = User[pp->PlayerSprite].Data();
pu = User[pp->SpriteP - sprite].Data();
if (TEST(pp->Flags, PF_DEAD))
continue;
@ -6374,7 +6369,7 @@ KeyMain:
sp->x, sp->y, sp->z, 0, 0);
np = &sprite[New];
nu = User[New];
nu = User[New].Data();
np->shade = -20;
// Attach flag to player
@ -6410,7 +6405,7 @@ KeyMain:
void
SetEnemyActive(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SET(u->Flags, SPR_ACTIVE);
u->inactive_time = 0;
@ -6419,7 +6414,7 @@ SetEnemyActive(short SpriteNum)
void
SetEnemyInactive(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
RESET(u->Flags, SPR_ACTIVE);
}
@ -6430,7 +6425,7 @@ SetEnemyInactive(short SpriteNum)
void
ProcessActiveVars(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
#define TIME_TILL_INACTIVE (4*120)
if (!TEST(u->Flags, SPR_ACTIVE))
@ -6452,7 +6447,7 @@ ProcessActiveVars(short SpriteNum)
void
AdjustActiveRange(PLAYERp pp, short SpriteNum, int dist)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
SPRITEp psp = pp->SpriteP;
int look_height;
@ -6589,7 +6584,7 @@ AdjustActiveRange(PLAYERp pp, short SpriteNum, int dist)
int
StateControl(int16_t SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = &sprite[SpriteNum];
short StateTics;
@ -6694,8 +6689,8 @@ SpriteControl(void)
while ((i = it.NextIndex()) >= 0)
{
#if INLINE_STATE
ASSERT(User[i]);
u = User[i];
ASSERT(User[i].Data());
u = User[i].Data();
sp = User[i]->SpriteP;
STATE_CONTROL(i, sp, u, StateTics)
// ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()] != NULL : true);
@ -6715,11 +6710,11 @@ SpriteControl(void)
while ((i = it.NextIndex()) >= 0)
{
#if INLINE_STATE
ASSERT(User[i]);
u = User[i];
ASSERT(User[i].Data());
u = User[i].Data();
sp = User[i]->SpriteP;
STATE_CONTROL(i, sp, u, StateTics)
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()] != NULL : true);
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()].Data() != NULL : true);
#else
ASSERT(User[i]);
StateControl(i);
@ -6735,12 +6730,11 @@ SpriteControl(void)
StatIterator it(STAT_ENEMY);
while ((i = it.NextIndex()) >= 0)
{
ASSERT(User[i]);
ASSERT(User[i].Data());
u = User[i];
u = User[i].Data();
sp = u->SpriteP;
CloseToPlayer = false;
ProcessActiveVars(i);
@ -6766,15 +6760,13 @@ SpriteControl(void)
if (CloseToPlayer)
{
#if INLINE_STATE
u = User[i];
u = User[i].Data();
sp = User[i]->SpriteP;
STATE_CONTROL(i, sp, u, StateTics)
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()] != NULL : true);
#else
StateControl(i);
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()] != NULL : true);
#endif
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()] != NULL : true);
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()].Data() != NULL : true);
}
else
{
@ -6793,15 +6785,15 @@ SpriteControl(void)
while ((i = it.NextIndex()) >= 0)
{
#if INLINE_STATE
ASSERT(User[i]);
u = User[i];
ASSERT(User[i].Data());
u = User[i].Data();
sp = User[i]->SpriteP;
STATE_CONTROL(i, sp, u, StateTics)
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()] != NULL : true);
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()].Data() != NULL : true);
#else
ASSERT(User[i]);
StateControl(i);
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()] != NULL : true);
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()].Data() != NULL : true);
#endif
}
}
@ -6810,7 +6802,7 @@ SpriteControl(void)
it.Reset(STAT_NO_STATE);
while ((i = it.NextIndex()) >= 0)
{
if (User[i] && User[i]->ActorActionFunc)
if (User[i].Data() && User[i]->ActorActionFunc)
(*User[i]->ActorActionFunc)(i);
ASSERT(it.PeekIndex() >= 0 ? sprite[it.PeekIndex()].statnum != MAXSTATUS : true);
}
@ -6821,7 +6813,7 @@ SpriteControl(void)
while ((i = it.NextIndex()) >= 0)
{
extern int DoStaticFlamesDamage(short SpriteNum);
ASSERT(User[i]);
ASSERT(User[i].Data());
DoStaticFlamesDamage(i);
}
}
@ -6831,11 +6823,11 @@ SpriteControl(void)
it.Reset(STAT_WALLBLOOD_QUEUE);
while ((i = it.NextIndex()) >= 0)
{
ASSERT(User[i]);
u = User[i];
ASSERT(User[i].Data());
u = User[i].Data();
sp = User[i]->SpriteP;
STATE_CONTROL(i, sp, u, StateTics)
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()] != NULL : true);
ASSERT(it.PeekIndex() >= 0 ? User[it.PeekIndex()].Data() != NULL : true);
}
}
@ -6845,7 +6837,7 @@ SpriteControl(void)
it.Reset(STAT_VATOR);
while ((i = it.NextIndex()) >= 0)
{
u = User[i];
u = User[i].Data();
if (u == 0)
continue;
@ -6866,7 +6858,7 @@ SpriteControl(void)
it.Reset(STAT_SPIKE);
while ((i = it.NextIndex()) >= 0)
{
u = User[i];
u = User[i].Data();
if (u->Tics)
{
@ -6888,7 +6880,7 @@ SpriteControl(void)
it.Reset(STAT_ROTATOR);
while ((i = it.NextIndex()) >= 0)
{
u = User[i];
u = User[i].Data();
if (u->Tics)
{
@ -6907,7 +6899,7 @@ SpriteControl(void)
it.Reset(STAT_SLIDOR);
while ((i = it.NextIndex()) >= 0)
{
u = User[i];
u = User[i].Data();
if (u->Tics)
{
@ -6949,7 +6941,7 @@ move_sprite(short spritenum, int xchange, int ychange, int zchange, int ceildist
int retval=0, zh;
short dasectnum, tempshort;
SPRITEp spr;
USERp u = User[spritenum];
USERp u = User[spritenum].Data();
short lastsectnum;
spr = &sprite[spritenum];
@ -7074,7 +7066,7 @@ move_sprite(short spritenum, int xchange, int ychange, int zchange, int ceildist
int pushmove_sprite(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
short sectnum, ret;
int daz;
@ -7098,7 +7090,7 @@ int pushmove_sprite(short SpriteNum)
void MissileWarpUpdatePos(short SpriteNum, short sectnum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
sp->backuppos();
u->oz = sp->oz;
@ -7108,7 +7100,7 @@ void MissileWarpUpdatePos(short SpriteNum, short sectnum)
void ActorWarpUpdatePos(short SpriteNum, short sectnum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
sp->backuppos();
u->oz = sp->oz;
@ -7157,7 +7149,7 @@ void ActorWarpType(SPRITEp sp, SPRITEp sp_warp)
int
MissileWaterAdjust(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (u->lo_sectp)
{
@ -7171,7 +7163,7 @@ MissileWaterAdjust(short SpriteNum)
int
MissileZrange(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
short tempshort;
@ -7197,7 +7189,7 @@ move_missile(short spritenum, int xchange, int ychange, int zchange, int ceildis
int retval, zh;
short dasectnum, tempshort;
SPRITEp sp;
USERp u = User[spritenum];
USERp u = User[spritenum].Data();
short lastsectnum;
sp = &sprite[spritenum];
@ -7336,7 +7328,7 @@ move_ground_missile(short spritenum, int xchange, int ychange, int ceildist, int
int retval=0;
short dasectnum;
SPRITEp sp;
USERp u = User[spritenum];
USERp u = User[spritenum].Data();
short lastsectnum;
int ox,oy;

View file

@ -638,12 +638,12 @@ SetupSumo(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,SUMO_RUN_R0,s_SumoRun[0]);
u = SpawnUser(SpriteNum,SUMO_RUN_R0,s_SumoRun[0]);
u->Health = 6000;
}
@ -680,7 +680,7 @@ SetupSumo(short SpriteNum)
int NullSumo(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
//if (TEST(u->Flags,SPR_SLIDING))
//DoActorSlide(SpriteNum);
@ -695,7 +695,7 @@ int NullSumo(short SpriteNum)
int DoSumoMove(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
//if (TEST(u->Flags,SPR_SLIDING))
//DoActorSlide(SpriteNum);
@ -719,7 +719,7 @@ int DoSumoMove(short SpriteNum)
int InitSumoCharge(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (RANDOM_P2(1024) > 950)
PlaySound(DIGI_SUMOALERT, sp, v3df_follow);
@ -737,7 +737,7 @@ int InitSumoCharge(short SpriteNum)
int DoSumoRumble(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SetSumoQuake(SpriteNum);
@ -787,7 +787,7 @@ int InitSumoClap(short SpriteNum)
int DoSumoDeathMelt(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
PlaySound(DIGI_SUMOFART, sp, v3df_follow);
@ -840,7 +840,7 @@ BossHealthMeter(void)
while ((i = it.NextIndex()) >= 0)
{
sp = &sprite[i];
u = User[i];
u = User[i].Data();
if ((u->ID == SERP_RUN_R0 || u->ID == SUMO_RUN_R0 || u->ID == ZILLA_RUN_R0) && sp->pal != 16)
{
@ -869,7 +869,7 @@ BossHealthMeter(void)
if (BossSpriteNum[i] >= 0)
{
sp = &sprite[BossSpriteNum[i]];
u = User[BossSpriteNum[i]];
u = User[BossSpriteNum[i]].Data();
if (cansee(sp->x, sp->y, SPRITEp_TOS(sp), sp->sectnum, pp->posx, pp->posy, pp->posz - Z(40), pp->cursectnum))
{
@ -914,7 +914,7 @@ BossHealthMeter(void)
continue;
sp = &sprite[BossSpriteNum[i]];
u = User[BossSpriteNum[i]];
u = User[BossSpriteNum[i]].Data();
if (u->ID == SERP_RUN_R0 && serpwasseen)
{

View file

@ -126,7 +126,7 @@ point to the sprite.
short
ActorFindTrack(short SpriteNum, int8_t player_dir, int track_type, short *track_point_num, short *track_dir)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
int dist, near_dist = 999999, zdiff;
@ -294,7 +294,7 @@ NextTrackPoint(SECTOR_OBJECTp sop)
void
NextActorTrackPoint(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
u->point += u->track_dir;
@ -732,7 +732,7 @@ SectorObjectSetupBounds(SECTOR_OBJECTp sop)
bool FoundOutsideLoop = false;
bool SectorInBounds;
SECTORp *sectp;
USERp u = User[sop->sp_child - sprite];
USERp u = User[sop->sp_child - sprite].Data();
static unsigned char StatList[] =
{
@ -904,10 +904,10 @@ SectorObjectSetupBounds(SECTOR_OBJECTp sop)
continue;
}
if (User[sp_num] == NULL)
if (User[sp_num].Data() == NULL)
u = SpawnUser(sp_num, 0, NULL);
else
u = User[sp_num];
u = User[sp_num].Data();
u->RotNum = 0;
@ -1013,7 +1013,7 @@ cont:
for (i = 0; sop->sp_num[i] != -1; i++)
{
sp = &sprite[sop->sp_num[i]];
u = User[sop->sp_num[i]];
u = User[sop->sp_num[i]].Data();
if (sp->z > zmid)
zmid = sp->z;
@ -1026,7 +1026,7 @@ cont:
for (i = 0; sop->sp_num[i] != -1; i++)
{
sp = &sprite[sop->sp_num[i]];
u = User[sop->sp_num[i]];
u = User[sop->sp_num[i]].Data();
u->sz = sop->zmid - sp->z;
}
@ -1129,7 +1129,7 @@ SetupSectorObject(short sectnum, short tag)
New = SpawnSprite(STAT_SO_SP_CHILD, 0, NULL, sectnum,
sop->xmid, sop->ymid, sop->zmid, 0, 0);
sop->sp_child = &sprite[New];
u = User[New];
u = User[New].Data();
u->sop_parent = sop;
SET(u->Flags2, SPR2_SPRITE_FAKE_BLOCK); // for damage test
@ -1560,7 +1560,7 @@ PlaceActorsOnTracks(void)
int low_dist = 999999, dist;
sp = User[i]->SpriteP;
u = User[i];
u = User[i].Data();
tag = LOW_TAG_SPRITE(i);
@ -1801,7 +1801,7 @@ PlayerPart:
for (i = 0; sop->sp_num[i] != -1; i++)
{
sp = &sprite[sop->sp_num[i]];
u = User[sop->sp_num[i]];
u = User[sop->sp_num[i]].Data();
// if its a player sprite || NOT attached
if (!u || u->PlayerP || !TEST(u->Flags, SPR_SO_ATTACHED))
@ -2032,7 +2032,7 @@ void KillSectorObjectSprites(SECTOR_OBJECTp sop)
for (i = 0; sop->sp_num[i] != -1; i++)
{
sp = &sprite[sop->sp_num[i]];
u = User[sop->sp_num[i]];
u = User[sop->sp_num[i]].Data();
// not a part of the so anymore
RESET(u->Flags, SPR_SO_ATTACHED);
@ -2316,7 +2316,7 @@ void CallbackSOsink(ANIMp ap, void *data)
while ((i = it.NextIndex()) >= 0)
{
sp = &sprite[i];
u = User[i];
u = User[i].Data();
if (!u || u->PlayerP || !TEST(u->Flags, SPR_SO_ATTACHED))
continue;
@ -2833,7 +2833,7 @@ void VehicleSetSmoke(SECTOR_OBJECTp sop, ANIMATORp animator)
while ((SpriteNum = it.NextIndex()) >= 0)
{
sp = &sprite[SpriteNum];
u = User[SpriteNum];
u = User[SpriteNum].Data();
switch (sp->hitag)
{
@ -2954,7 +2954,7 @@ DoAutoTurretObject(SECTOR_OBJECTp sop)
{
short SpriteNum = sop->sp_child - sprite;
SPRITEp shootp;
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
short delta_ang;
int diff;
short i;
@ -3110,7 +3110,7 @@ DoActorHitTrackEndPoint(USERp u)
void
ActorLeaveTrack(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (u->track == -1)
return;
@ -3134,7 +3134,7 @@ bool
ActorTrackDecide(TRACK_POINTp tpoint, short SpriteNum)
{
SPRITEp sp;
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
sp = u->SpriteP;
@ -3682,7 +3682,7 @@ present time.
int
ActorFollowTrack(short SpriteNum, short locktics)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
PLAYERp pp;

View file

@ -47,7 +47,7 @@ int InitBloodSpray(short, bool, short);
void ReverseVator(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
// if paused go ahead and start it up again
@ -101,7 +101,7 @@ VatorSwitch(short match, short setting)
void SetVatorActive(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
SECTORp sectp = &sector[sp->sectnum];
@ -129,7 +129,7 @@ void SetVatorActive(short SpriteNum)
void SetVatorInactive(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
SECTORp sectp = &sector[sp->sectnum];
@ -233,7 +233,7 @@ DoVatorMatch(PLAYERp pp, short match)
if (SP_TAG1(fsp) == SECT_VATOR && SP_TAG2(fsp) == match)
{
fu = User[i];
fu = User[i].Data();
if (first_vator == -1)
first_vator = i;
@ -305,7 +305,7 @@ TestVatorMatchActive(short match)
if (SP_TAG1(fsp) == SECT_VATOR && SP_TAG2(fsp) == match)
{
fu = User[i];
fu = User[i].Data();
// Does not have to be inactive to be operated
if (TEST_BOOL6(fsp))
@ -329,7 +329,7 @@ void InterpSectorSprites(short sectnum, bool state)
{
sp = &sprite[i];
if (User[i])
if (User[i].Data())
{
if (TEST(User[i]->Flags, SPR_SKIP4) && sp->statnum <= STAT_SKIP4_INTERP_END)
continue;
@ -359,7 +359,7 @@ void MoveSpritesWithSector(short sectnum, int z_amt, bool type)
{
sp = &sprite[i];
if (User[i])
if (User[i].Data())
{
switch (sp->statnum)
{
@ -415,7 +415,7 @@ cont:
int DoVatorMove(short SpriteNum, int *lptr)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
int zval;
int move_amt;
@ -455,7 +455,7 @@ int DoVatorMove(short SpriteNum, int *lptr)
int DoVator(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
SECTORp sectp = &sector[sp->sectnum];
int *lptr;
@ -550,7 +550,7 @@ int DoVator(short SpriteNum)
while ((i = it.NextIndex()) >= 0)
{
bsp = &sprite[i];
bu = User[i];
bu = User[i].Data();
if (bsp->statnum == STAT_ENEMY)
{
@ -624,7 +624,7 @@ int DoVator(short SpriteNum)
int DoVatorAuto(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = u->SpriteP;
SECTORp sectp = &sector[sp->sectnum];
int *lptr;

View file

@ -75,7 +75,7 @@ void ProcessVisOn(void)
VIS_VisCur(sp) = NormalVisibility;
if (sp->owner >= 0)
{
ASSERT(User[sp->owner]);
ASSERT(User[sp->owner].Data());
RESET(User[sp->owner]->Flags2, SPR2_VIS_SHADING);
}
KillSprite(i);
@ -157,7 +157,7 @@ int SpawnVis(short Parent, short sectnum, int x, int y, int z, int amt)
sp->owner = Parent;
ASSERT(User[Parent]);
ASSERT(User[Parent].Data());
SET(User[Parent]->Flags2, SPR2_CHILDREN);
sp->x = sprite[Parent].x;

View file

@ -62,7 +62,7 @@ void SOwallmove(SECTOR_OBJECTp sop, SPRITEp sp, WALLp find_wallp, int dist, int
{
short ang;
// move orig x and y in saved angle
ASSERT(User[sp - sprite]);
ASSERT(User[sp - sprite].Data());
ang = User[sp - sprite]->sang;
*nx = MulScale(dist, bcos(ang), 14);

File diff suppressed because it is too large Load diff

View file

@ -649,12 +649,12 @@ SetupZilla(short SpriteNum)
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum];
u = User[SpriteNum].Data();
ASSERT(u);
}
else
{
User[SpriteNum] = u = SpawnUser(SpriteNum,ZILLA_RUN_R0,s_ZillaRun[0]);
u = SpawnUser(SpriteNum,ZILLA_RUN_R0,s_ZillaRun[0]);
u->Health = 6000;
}
@ -680,7 +680,7 @@ SetupZilla(short SpriteNum)
int NullZilla(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
//if (TEST(u->Flags,SPR_SLIDING))
@ -713,7 +713,7 @@ int NullZilla(short SpriteNum)
int DoZillaMove(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
short choose;
//if (TEST(u->Flags,SPR_SLIDING))
@ -763,7 +763,7 @@ extern int SpawnGrenadeExp(int16_t Weapon);
int DoZillaDeathMelt(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (RANDOM_RANGE(1000) > 800)
SpawnGrenadeExp(SpriteNum);

View file

@ -752,7 +752,7 @@ int
SetupZombie(short SpriteNum)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
ANIMATOR DoActorDecide;
u->Health = 100;
@ -790,7 +790,7 @@ SpawnZombie(PLAYERp pp, short Weapon)
New = SpawnSprite(STAT_ENEMY, ZOMBIE_RUN_R0, s_ZombieRun[0], pp->cursectnum, pp->posx, pp->posy, pp->posz, pp->angle.ang.asbuild(), 0);
np = &sprite[New];
nu = User[New];
nu = User[New].Data();
np->sectnum = pp->cursectnum;
np->owner = owner;
np->pal = nu->spal = User[owner]->spal;
@ -853,7 +853,7 @@ SpawnZombie2(short Weapon)
//Zombies++;
New = SpawnSprite(STAT_ENEMY, ZOMBIE_RUN_R0, s_ZombieRun[0], sp->sectnum, sp->x, sp->y, sp->z, sp->ang, 0);
np = &sprite[New];
nu = User[New];
nu = User[New].Data();
nu->Counter3 = 0;
np->owner = owner;
np->pal = nu->spal = User[owner]->spal;
@ -882,7 +882,7 @@ SpawnZombie2(short Weapon)
int
DoZombieMove(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (u->Counter3++ >= ZOMBIE_TIME_LIMIT)
{
@ -893,7 +893,7 @@ DoZombieMove(short SpriteNum)
return 0;
}
if (u->tgt_sp && User[u->tgt_sp-sprite] && TEST(User[u->tgt_sp-sprite]->Flags, PF_DEAD)) // JBF: added User[] null check
if (u->tgt_sp && User[u->tgt_sp-sprite].Data() && TEST(User[u->tgt_sp-sprite]->Flags, PF_DEAD)) // JBF: added User[] null check
DoActorPickClosePlayer(SpriteNum);
// jumping and falling
@ -932,7 +932,7 @@ DoZombieMove(short SpriteNum)
int
NullZombie(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
if (u->Counter3++ >= ZOMBIE_TIME_LIMIT)
{
@ -943,7 +943,7 @@ NullZombie(short SpriteNum)
return 0;
}
if (u->tgt_sp && User[u->tgt_sp-sprite] && TEST(User[u->tgt_sp-sprite]->Flags, PF_DEAD))
if (u->tgt_sp && User[u->tgt_sp-sprite].Data() && TEST(User[u->tgt_sp-sprite]->Flags, PF_DEAD))
DoActorPickClosePlayer(SpriteNum);
if (u->WaitTics > 0)
@ -963,7 +963,7 @@ NullZombie(short SpriteNum)
int DoZombiePain(short SpriteNum)
{
USERp u = User[SpriteNum];
USERp u = User[SpriteNum].Data();
NullZombie(SpriteNum);