- owner cleanup.

This commit is contained in:
Christoph Oelckers 2021-11-03 00:14:09 +01:00
parent 411c814dc3
commit 36067baedd
7 changed files with 12 additions and 12 deletions

View file

@ -2692,7 +2692,7 @@ void DoPlayerMoveVehicle(PLAYERp pp)
else
SetCollision(u, 0);
VehicleMoveHit(short(sp - sprite));
VehicleMoveHit(actor);
}
if (!TEST(sop->flags, SOBJ_NO_QUAKE))
@ -2743,7 +2743,7 @@ void DoPlayerMoveVehicle(PLAYERp pp)
if (vel > 13000)
{
VehicleMoveHit(short(sp - sprite));
VehicleMoveHit(actor);
pp->slide_xvect = -pp->xvect<<1;
pp->slide_yvect = -pp->yvect<<1;
if (!TEST(sop->flags, SOBJ_NO_QUAKE))

View file

@ -348,7 +348,7 @@ int DoRotator(DSWActor* actor)
SetRotatorInactive(actor);
// set owner swith back to OFF
// set Owner swith back to OFF
// only if ALL vators are inactive
if (!TestRotatorMatchActive(match))
{

View file

@ -282,8 +282,9 @@ int DoSkullBeginDeath(DSWActor* actor)
int16_t i,num_ord=0;
// Decrease for Serp God
if (sp->owner >= 0)
User[sp->owner]->Counter--;
auto own = GetOwner(actor);
if (own != nullptr && own->hasU())
own->u()->Counter--;
// starts the explosion that does the actual damage

View file

@ -573,7 +573,7 @@ int DoSlidor(DSWActor* actor)
RESET_BOOL8(sp);
// set owner swith back to OFF
// set Owner swith back to OFF
// only if ALL vators are inactive
if (!TestSlidorMatchActive(match))
{

View file

@ -728,7 +728,7 @@ void DeleteNoSoundOwner(DSWActor* actor)
//==========================================================================
//
// This is called from KillSprite to kill a follow sound with no valid sprite owner
// This is called from KillSprite to kill a follow sound with no valid sprite Owner
// Stops any active sound with the follow bit set, even play once sounds.
//
//==========================================================================

View file

@ -4307,10 +4307,9 @@ int SpawnBlood(DSWActor* actor, DSWActor* weapActor, short hit_ang, int hit_x, i
}
bool
VehicleMoveHit(short SpriteNum)
bool VehicleMoveHit(DSWActor* actor)
{
USERp u = User[SpriteNum].Data();
USERp u = actor->u();
SPRITEp cp;
SECTOR_OBJECTp sop;
SECTOR_OBJECTp hsop;
@ -4364,7 +4363,7 @@ VehicleMoveHit(short SpriteNum)
{
if (hsp->statnum == STAT_MINE_STUCK)
{
DoDamage(hit_sprite, SpriteNum);
DoDamage(hit_sprite, actor->GetSpriteIndex());
return true;
}
}

View file

@ -231,7 +231,7 @@ void QueueReset(void);
int PlayerCheckDeath(PLAYERp pp,short Weapon);
bool SpriteWarpToUnderwater(SPRITEp sp);
int PlayerDamageSlide(PLAYERp pp,int damage,short ang);
bool VehicleMoveHit(short SpriteNum);
bool VehicleMoveHit(DSWActor*);
int SpawnSplash(short SpriteNum);
int SpawnMineExp(int16_t Weapon);
int SpawnLittleExp(int16_t Weapon);