mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-20 18:42:26 +00:00
- updatesectorz with DVector3.
This commit is contained in:
parent
643d3e7eba
commit
21944d5ac2
2 changed files with 9 additions and 2 deletions
|
@ -124,6 +124,13 @@ inline void updatesectorz(int x, int y, int z, sectortype** const sectp)
|
|||
*sectp = sectno == -1 ? nullptr : §or[sectno];
|
||||
}
|
||||
|
||||
inline void updatesectorz(const DVector3& pos, sectortype** const sectp)
|
||||
{
|
||||
int sectno = *sectp ? sector.IndexOf(*sectp) : -1;
|
||||
updatesectorz(int(pos.X * worldtoint), int(pos.Y * worldtoint), int(pos.Z * zworldtoint), §no);
|
||||
*sectp = sectno == -1 ? nullptr : §or[sectno];
|
||||
}
|
||||
|
||||
inline void updatesectorneighbor(int x, int y, sectortype** const sect, int maxDistance = MAXUPDATESECTORDIST)
|
||||
{
|
||||
int sectno = *sect? sector.IndexOf(*sect) : -1;
|
||||
|
|
|
@ -816,13 +816,13 @@ void SpawnZombie2(DSWActor* actor)
|
|||
if (FAF_ConnectArea(actor->sector()))
|
||||
{
|
||||
auto newsect = actor->sector();
|
||||
updatesectorz(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z + Z(10), &newsect);
|
||||
updatesectorz(actor->spr.pos.plusZ(10), &newsect);
|
||||
if (SectorIsUnderwaterArea(newsect))
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
auto actorNew = SpawnActor(STAT_ENEMY, ZOMBIE_RUN_R0, s_ZombieRun[0], actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->int_ang(), 0);
|
||||
auto actorNew = SpawnActor(STAT_ENEMY, ZOMBIE_RUN_R0, s_ZombieRun[0], actor->sector(), actor->spr.pos, actor->spr.angle, 0);
|
||||
actorNew->user.Counter3 = 0;
|
||||
SetOwner(ownerActor, actorNew);
|
||||
actorNew->spr.pal = actorNew->user.spal = ownerActor->user.spal;
|
||||
|
|
Loading…
Reference in a new issue