- hitpos replacements in spawn calls

This commit is contained in:
Christoph Oelckers 2022-08-17 18:55:19 +02:00
parent 5505c362e2
commit 84f690654e
2 changed files with 13 additions and 12 deletions

View file

@ -301,7 +301,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
DDukeActor* spark;
if (p >= 0)
{
spark = EGS(hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, SHOTSPARK1, -15, 10, 10, sa, 0, 0, actor, 4);
spark = CreateActor(hit.hitSector, hit.hitpos, SHOTSPARK1, -15, 10, 10, sa, 0, 0, actor, 4);
if (!spark) return;
spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress];
spark->spr.extra += (krand() % 6);
@ -429,7 +429,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
}
else
{
spark = EGS(hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, SHOTSPARK1, -15, 24, 24, sa, 0, 0, actor, 4);
spark = CreateActor(hit.hitSector, hit.hitpos, SHOTSPARK1, -15, 24, 24, sa, 0, 0, actor, 4);
if (!spark) return;
spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress];

View file

@ -15309,7 +15309,7 @@ int InitUzi(PLAYER* pp)
}
auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang, 0);
auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit.hitSector, hit.hitpos, DAngle::fromBuild(daang), 0);
actorNew->spr.shade = -40;
actorNew->spr.xrepeat = UZI_SMOKE_REPEAT;
actorNew->spr.yrepeat = UZI_SMOKE_REPEAT;
@ -15320,7 +15320,7 @@ int InitUzi(PLAYER* pp)
HitscanSpriteAdjust(actorNew, hit.hitWall);
DoHitscanDamage(actorNew, hit.actor());
actorNew = SpawnActor(STAT_MISSILE, UZI_SPARK, s_UziSpark, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang, 0);
actorNew = SpawnActor(STAT_MISSILE, UZI_SPARK, s_UziSpark, hit.hitSector, hit.hitpos, DAngle::fromBuild(daang), 0);
actorNew->spr.shade = -40;
actorNew->spr.xrepeat = UZI_SPARK_REPEAT;
@ -16263,7 +16263,7 @@ int InitEnemyUzi(DSWActor* actor)
return 0;
}
auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE+2, s_UziSmoke, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang, 0);
auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE+2, s_UziSmoke, hit.hitSector, hit.hitpos, DAngle::fromBuild(daang), 0);
actorNew->spr.shade = -40;
actorNew->spr.xrepeat = UZI_SMOKE_REPEAT;
@ -16279,7 +16279,7 @@ int InitEnemyUzi(DSWActor* actor)
actorNew->spr.clipdist = 32L >> 2;
actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang, 0);
actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit.hitSector, hit.hitpos, DAngle::fromBuild(daang), 0);
actorNew->spr.shade = -40;
actorNew->spr.xrepeat = UZI_SMOKE_REPEAT;
actorNew->spr.yrepeat = UZI_SMOKE_REPEAT;
@ -16290,7 +16290,7 @@ int InitEnemyUzi(DSWActor* actor)
HitscanSpriteAdjust(actorNew, hit.hitWall);
DoHitscanDamage(actorNew, hit.actor());
actorNew = SpawnActor(STAT_MISSILE, UZI_SPARK, s_UziSpark, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang, 0);
actorNew = SpawnActor(STAT_MISSILE, UZI_SPARK, s_UziSpark, hit.hitSector, hit.hitpos, DAngle::fromBuild(daang), 0);
actorNew->spr.shade = -40;
actorNew->spr.xrepeat = UZI_SPARK_REPEAT;
@ -17670,6 +17670,7 @@ DSWActor* QueueWallBlood(DSWActor* actor, short ang)
short rndnum;
int daz;
HitInfo hit{};
DAngle bang = DAngle::fromBuild(ang);
if (actor->user.Flags & (SPR_UNDERWATER) || SpriteInUnderwaterArea(actor) || SpriteInDiveArea(actor))
return nullptr; // No blood underwater!
@ -17712,22 +17713,22 @@ DSWActor* QueueWallBlood(DSWActor* actor, short ang)
if (rndnum > 768)
{
WallBloodQueue[WallBloodQueueHead] = spawnedActor =
SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD1, s_WallBlood1, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, ang, 0);
SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD1, s_WallBlood1, hit.hitSector, hit.hitpos, bang, 0);
}
else if (rndnum > 512)
{
WallBloodQueue[WallBloodQueueHead] = spawnedActor =
SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD2, s_WallBlood2, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, ang, 0);
SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD2, s_WallBlood2, hit.hitSector, hit.hitpos, bang, 0);
}
else if (rndnum > 128)
{
WallBloodQueue[WallBloodQueueHead] = spawnedActor =
SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD3, s_WallBlood3, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, ang, 0);
SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD3, s_WallBlood3, hit.hitSector, hit.hitpos, bang, 0);
}
else
{
WallBloodQueue[WallBloodQueueHead] = spawnedActor =
SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD4, s_WallBlood4, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, ang, 0);
SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD4, s_WallBlood4, hit.hitSector, hit.hitpos, bang, 0);
}
WallBloodQueueHead = (WallBloodQueueHead+1) & (MAX_WALLBLOOD_QUEUE-1);
@ -17740,7 +17741,7 @@ DSWActor* QueueWallBlood(DSWActor* actor, short ang)
spawnedActor->spr.extra = 0;
spawnedActor->spr.clipdist = 0;
spawnedActor->spr.xoffset = spawnedActor->spr.yoffset = 0;
spawnedActor->set_int_pos(hit.int_hitpos());
spawnedActor->spr.pos = hit.hitpos;
spawnedActor->spr.shade -= 5; // Brighten it up just a bit
spawnedActor->tempwall = hit.hitWall; // pass hitinfo.wall