- some simple stuff

This commit is contained in:
Christoph Oelckers 2022-08-31 22:28:10 +02:00
parent c7c9ab52ce
commit 574a24aded
3 changed files with 6 additions and 8 deletions

View file

@ -455,7 +455,7 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITY* perso
if (depth && abs(actor->spr.pos.Z - actor->user.loz) < 8)
{
actor->add_int_z(Z(depth));
actor->spr.pos.Z += depth;
actor->user.loz = actor->spr.pos.Z;
actor->backupz();
}

View file

@ -1401,7 +1401,6 @@ void PreMapCombineFloors(void)
const int MAX_FLOORS = 32;
int i, j, k;
int base_offset;
int dx, dy;
short pnum;
struct BOUND_LIST
@ -1439,8 +1438,7 @@ void PreMapCombineFloors(void)
continue;
}
dx = BoundList[base_offset].offset->int_pos().X - BoundList[i].offset->int_pos().X;
dy = BoundList[base_offset].offset->int_pos().Y - BoundList[i].offset->int_pos().Y;
DVector2 dv = BoundList[base_offset].offset->spr.pos.XY() - BoundList[i].offset->spr.pos.XY();
BFSSectorSearch search(BoundList[i].offset->sector());
while (auto dasect = search.GetNext())
@ -1448,12 +1446,12 @@ void PreMapCombineFloors(void)
SWSectIterator it2(dasect);
while (auto jActor = it2.Next())
{
jActor->add_int_pos({ dx, dy, 0 });
jActor->spr.pos += dv;
}
for (auto& wal : wallsofsector(dasect))
{
wal.movexy(wal.wall_int_pos().X + dx, wal.wall_int_pos().Y + dy);
wal.move(wal.pos + dv);
if (wal.twoSided())
search.Add(wal.nextSector());
@ -1469,7 +1467,7 @@ void PreMapCombineFloors(void)
{
if (itsect == dasect)
{
pp->add_int_ppos_XY({ dx, dy });
pp->pos += dv;
pp->opos.XY() = pp->oldpos.XY() = pp->pos.XY();
break;
}

View file

@ -3760,7 +3760,7 @@ AutoShrap:
if (shrap_rand_zamt)
{
actor->add_int_z(Z(RandomRange(shrap_rand_zamt) - (shrap_rand_zamt/2)));
actor->spr.pos.Z += RandomRange(shrap_rand_zamt) - (shrap_rand_zamt/2);
}
actor->spr.pal = actor->user.spal = uint8_t(shrap_pal);