mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-20 18:42:26 +00:00
- CanHitPlayer
This commit is contained in:
parent
ceb3ac2e5b
commit
125159772d
2 changed files with 6 additions and 7 deletions
|
@ -298,10 +298,10 @@ bool CanSeePlayer(DSWActor* actor)
|
|||
}
|
||||
|
||||
int
|
||||
CanHitPlayer(short SpriteNum)
|
||||
CanHitPlayer(DSWActor* actor)
|
||||
{
|
||||
USERp u = User[SpriteNum].Data();
|
||||
SPRITEp sp = User[SpriteNum]->SpriteP, hp;
|
||||
USERp u = actor->u();
|
||||
SPRITEp sp = &actor->s();
|
||||
hitdata_t hitinfo;
|
||||
int xvect,yvect,zvect;
|
||||
short ang,ret=false;
|
||||
|
@ -313,7 +313,7 @@ CanHitPlayer(short SpriteNum)
|
|||
|
||||
zhs = sp->z - DIV2(SPRITEp_SIZE_Z(sp));
|
||||
|
||||
hp = u->tgt_sp;
|
||||
auto hp = u->tgt_sp;
|
||||
|
||||
// get angle to target
|
||||
ang = getangle(hp->x - sp->x, hp->y - sp->y);
|
||||
|
@ -1440,7 +1440,7 @@ InitActorAttack(DSWActor* actor)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (!CanHitPlayer(SpriteNum))
|
||||
if (!CanHitPlayer(actor))
|
||||
{
|
||||
InitActorReposition(actor);
|
||||
return 0;
|
||||
|
@ -1836,7 +1836,7 @@ FindNewAngle(short SpriteNum, signed char dir, int DistToMove)
|
|||
break;
|
||||
case AWAY:
|
||||
set = RANDOM_P2(4<<8)>>8;
|
||||
if (CanHitPlayer(SpriteNum))
|
||||
if (CanHitPlayer(actor))
|
||||
{
|
||||
adp = &toward_angle_delta[set][0];
|
||||
}
|
||||
|
|
|
@ -74,7 +74,6 @@ void DebugMoveHit(DSWActor* actor);
|
|||
bool ActorMoveHitReact(DSWActor* actor);
|
||||
short ChooseActionNumber(short decision[]);
|
||||
bool CanSeePlayer(DSWActor* actor);
|
||||
int CanHitPlayer(short SpriteNum);
|
||||
int DoActorPickClosePlayer(short SpriteNum);
|
||||
int CloseRangeDist(SPRITEp sp1,SPRITEp sp2);
|
||||
int InitActorDecide(DSWActor* actor);
|
||||
|
|
Loading…
Reference in a new issue