- floatified DoActorOperate

This commit is contained in:
Christoph Oelckers 2022-08-21 18:17:21 +02:00
parent 072cb5ccdf
commit ef1e77514d
2 changed files with 10 additions and 5 deletions

View file

@ -162,6 +162,11 @@ inline int hitscan(const DVector3& start, const sectortype* startsect, const vec
}
void neartag(const vec3_t& pos, sectortype* sect, int angle, HitInfoBase& result, int neartagrange, int tagsearch);
inline void neartag(const DVector3& start, sectortype* sect, DAngle angle, HitInfoBase& result, int neartagrange, int tagsearch)
{
vec3_t vec(start.X * worldtoint, start.Y * worldtoint, start.Z * zworldtoint);
neartag(vec, sect, angle.Buildang(), result, neartagrange, tagsearch);
}
int cansee(int x1, int y1, int z1, sectortype* sect1, int x2, int y2, int z2, sectortype* sect2);

View file

@ -393,7 +393,7 @@ int CloseRangeDist(DSWActor* actor1, DSWActor* actor2)
int DoActorOperate(DSWActor* actor)
{
HitInfo near{};
int z[2];
double z[2];
unsigned int i;
if (actor->user.ID == HORNET_RUN_R0 || actor->user.ID == EEL_RUN_R0 || actor->user.ID == BUNNY_RUN_R0)
@ -405,15 +405,15 @@ int DoActorOperate(DSWActor* actor)
if ((actor->user.WaitTics -= ACTORMOVETICS) > 0)
return false;
z[0] = actor->int_pos().Z - int_ActorSizeZ(actor) + Z(5);
z[1] = actor->int_pos().Z - (int_ActorSizeZ(actor) >> 1);
z[0] = -ActorSizeZ(actor) + 5;
z[1] = -(ActorSizeZ(actor) * 0.5);
for (i = 0; i < SIZ(z); i++)
{
neartag({ actor->int_pos().X, actor->int_pos().Y, z[i] }, actor->sector(), actor->int_ang(), near, 1024, NTAG_SEARCH_LO_HI);
neartag(actor->spr.pos.plusZ(z[i]), actor->sector(), actor->spr.angle, near, 1024, NTAG_SEARCH_LO_HI);
}
if (near.hitSector != nullptr && near.int_hitpos().X < 1024)
if (near.hitSector != nullptr && near.hitpos.X < 64)
{
if (OperateSector(near.hitSector, false))
{