mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-26 14:01:05 +00:00
- floatified nnExtSpawnDude.
This commit is contained in:
parent
0eacc8e68e
commit
a618161387
1 changed files with 10 additions and 11 deletions
|
@ -255,26 +255,25 @@ CONDITION_TYPE_NAMES gCondTypeNames[7] = {
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
static DBloodActor* nnExtSpawnDude(DBloodActor* sourceactor, DBloodActor* origin, int nType, int a3, int a4)
|
static DBloodActor* nnExtSpawnDude(DBloodActor* sourceactor, DBloodActor* origin, int nType, double dist, double zadd)
|
||||||
{
|
{
|
||||||
DBloodActor* pDudeActor = nullptr;
|
DBloodActor* pDudeActor = nullptr;
|
||||||
|
|
||||||
if (nType < kDudeBase || nType >= kDudeMax || (pDudeActor = actSpawnSprite(origin, kStatDude)) == NULL)
|
if (nType < kDudeBase || nType >= kDudeMax || (pDudeActor = actSpawnSprite(origin, kStatDude)) == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
int angle = origin->int_ang();
|
DAngle angle = origin->spr.angle;
|
||||||
auto pos = origin->spr.pos.plusZ(a4 * zinttoworld);
|
auto pos = origin->spr.pos.plusZ(zadd);
|
||||||
|
|
||||||
if (a3 >= 0)
|
if (dist >= 0)
|
||||||
{
|
{
|
||||||
pos.X += mulscale30r(Cos(angle), a3) * inttoworld;
|
pos += angle.ToVector() * dist;
|
||||||
pos.Y += mulscale30r(Sin(angle), a3) * inttoworld;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SetActor(pDudeActor, pos);
|
SetActor(pDudeActor, pos);
|
||||||
|
|
||||||
pDudeActor->spr.type = nType;
|
pDudeActor->spr.type = nType;
|
||||||
pDudeActor->set_int_ang(angle);
|
pDudeActor->spr.angle = angle;
|
||||||
|
|
||||||
pDudeActor->spr.cstat |= CSTAT_SPRITE_BLOOD_BIT1 | CSTAT_SPRITE_BLOCK_ALL;
|
pDudeActor->spr.cstat |= CSTAT_SPRITE_BLOOD_BIT1 | CSTAT_SPRITE_BLOCK_ALL;
|
||||||
pDudeActor->set_native_clipdist(getDudeInfo(nType)->clipdist);
|
pDudeActor->set_native_clipdist(getDudeInfo(nType)->clipdist);
|
||||||
|
@ -1000,12 +999,12 @@ static DBloodActor* randomDropPickupObject(DBloodActor* sourceactor, int prevIte
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
DBloodActor* randomSpawnDude(DBloodActor* sourceactor, DBloodActor* origin, int a3, int a4)
|
DBloodActor* randomSpawnDude(DBloodActor* sourceactor, DBloodActor* origin, double dist, double zadd)
|
||||||
{
|
{
|
||||||
DBloodActor* spawned = NULL; int selected = -1;
|
DBloodActor* spawned = NULL; int selected = -1;
|
||||||
|
|
||||||
if ((selected = randomGetDataValue(sourceactor, kRandomizeDude)) > 0)
|
if ((selected = randomGetDataValue(sourceactor, kRandomizeDude)) > 0)
|
||||||
spawned = nnExtSpawnDude(sourceactor, origin, selected, a3, 0);
|
spawned = nnExtSpawnDude(sourceactor, origin, selected, dist, zadd);
|
||||||
|
|
||||||
return spawned;
|
return spawned;
|
||||||
}
|
}
|
||||||
|
@ -5585,8 +5584,8 @@ void useCustomDudeSpawn(DBloodActor* pSource, DBloodActor* pActor)
|
||||||
|
|
||||||
void useDudeSpawn(DBloodActor* pSource, DBloodActor* pActor)
|
void useDudeSpawn(DBloodActor* pSource, DBloodActor* pActor)
|
||||||
{
|
{
|
||||||
if (randomSpawnDude(pSource, pActor, pActor->native_clipdist() << 1, 0) == nullptr)
|
if (randomSpawnDude(pSource, pActor, pActor->fClipdist() * 0.5, 0) == nullptr)
|
||||||
nnExtSpawnDude(pSource, pActor, pActor->xspr.data1, pActor->native_clipdist() << 1, 0);
|
nnExtSpawnDude(pSource, pActor, pActor->xspr.data1, pActor->fClipdist() * 0.5, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue