mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-20 18:42:26 +00:00
- add a float version of ActorZOfMiddle.
This commit is contained in:
parent
cdff2b12cc
commit
46aa695b54
3 changed files with 12 additions and 7 deletions
|
@ -2026,6 +2026,11 @@ inline int int_ActorZOfMiddle(DSWActor* actor)
|
|||
return (ActorZOfTop(actor) + ActorZOfBottom(actor)) >> 1;
|
||||
}
|
||||
|
||||
inline double ActorZOfMiddle(DSWActor* actor)
|
||||
{
|
||||
return (ActorZOfTop(actor) + ActorZOfBottom(actor)) * zinttoworld * 0.5;
|
||||
}
|
||||
|
||||
inline int ActorSizeZ(DSWActor* actor)
|
||||
{
|
||||
return (tileHeight(actor->spr.picnum) * actor->spr.yrepeat) << 2;
|
||||
|
|
|
@ -1918,8 +1918,8 @@ int DoCarryFlag(DSWActor* actor)
|
|||
// if no Owner then die
|
||||
if (attached != nullptr)
|
||||
{
|
||||
vec3_t pos = { attached->int_pos().X, attached->int_pos().Y, int_ActorZOfMiddle(attached) };
|
||||
SetActorZ(actor, &pos);
|
||||
DVector3 pos(attached->spr.pos.XY(), ActorZOfMiddle(attached));
|
||||
SetActorZ(actor, pos);
|
||||
actor->set_int_ang(NORM_ANGLE(attached->int_ang() + 1536));
|
||||
}
|
||||
|
||||
|
|
|
@ -3518,7 +3518,7 @@ int ActorCoughItem(DSWActor* actor)
|
|||
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
||||
actorNew->spr.cstat = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, int_ActorZOfMiddle(actor) });
|
||||
actorNew->spr.pos = { actor->spr.pos.XY(), ActorZOfMiddle(actor) };
|
||||
actorNew->set_int_ang(0);
|
||||
actorNew->spr.extra = 0;
|
||||
|
||||
|
@ -3557,7 +3557,7 @@ int ActorCoughItem(DSWActor* actor)
|
|||
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
||||
actorNew->spr.cstat = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, int_ActorZOfMiddle(actor) });
|
||||
actorNew->spr.pos = { actor->spr.pos.XY(), ActorZOfMiddle(actor) };
|
||||
actorNew->set_int_ang(0);
|
||||
actorNew->spr.extra = 0;
|
||||
|
||||
|
@ -3583,7 +3583,7 @@ int ActorCoughItem(DSWActor* actor)
|
|||
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
||||
actorNew->spr.cstat = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, int_ActorZOfMiddle(actor) });
|
||||
actorNew->spr.pos = { actor->spr.pos.XY(), ActorZOfMiddle(actor) };
|
||||
actorNew->set_int_ang(0);
|
||||
actorNew->spr.extra = 0;
|
||||
|
||||
|
@ -3612,7 +3612,7 @@ int ActorCoughItem(DSWActor* actor)
|
|||
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
||||
actorNew->spr.cstat = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, int_ActorZOfMiddle(actor) });
|
||||
actorNew->spr.pos = { actor->spr.pos.XY(), ActorZOfMiddle(actor) };
|
||||
actorNew->set_int_ang(0);
|
||||
actorNew->spr.extra = 0;
|
||||
|
||||
|
@ -3672,7 +3672,7 @@ int ActorCoughItem(DSWActor* actor)
|
|||
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
|
||||
actorNew->spr.cstat = 0;
|
||||
actorNew->spr.extra = 0;
|
||||
actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, int_ActorZOfMiddle(actor) });
|
||||
actorNew->spr.pos = { actor->spr.pos.XY(), ActorZOfMiddle(actor) };
|
||||
actorNew->set_int_ang(0);
|
||||
actorNew->spr.extra = 0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue