- preparations for allowing hitscans through portals.
To allow processing the hit through an arbitrary portal without reference to the portal group table, P_AimLineAttack and P_LineAttack need to pass some more info than just the linetarget. We need the relative positions of shooter and target within the visual reference of the other to calculate proper angles and we need to know if such a portal was crossed at all, because a few things, e.g. seeker missiles won't work with them. - fixed setup of target acquisition for the Mage Staff. The pre-acquired seeker target was never passed to the spawned projectiles.
This commit is contained in:
parent
a16f92c508
commit
b4a002a07f
28 changed files with 331 additions and 279 deletions
|
|
@ -927,7 +927,7 @@ static inline bool isFakePain(AActor *target, AActor *inflictor, int damage)
|
|||
|
||||
// Returns the amount of damage actually inflicted upon the target, or -1 if
|
||||
// the damage was cancelled.
|
||||
int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, FName mod, int flags)
|
||||
int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, FName mod, int flags, angle_t angle)
|
||||
{
|
||||
unsigned ang;
|
||||
player_t *player = NULL;
|
||||
|
|
@ -1151,11 +1151,15 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
|||
{
|
||||
AActor *origin = (source && (flags & DMG_INFLICTOR_IS_PUFF))? source : inflictor;
|
||||
|
||||
// If the origin and target are in exactly the same spot, choose a random direction.
|
||||
// (Most likely cause is from telefragging somebody during spawning because they
|
||||
// haven't moved from their spawn spot at all.)
|
||||
if (origin->X() == target->X() && origin->Y() == target->Y())
|
||||
if (flags & DMG_USEANGLE)
|
||||
{
|
||||
ang = angle;
|
||||
}
|
||||
else if (origin->X() == target->X() && origin->Y() == target->Y())
|
||||
{
|
||||
// If the origin and target are in exactly the same spot, choose a random direction.
|
||||
// (Most likely cause is from telefragging somebody during spawning because they
|
||||
// haven't moved from their spawn spot at all.)
|
||||
ang = pr_kickbackdir.GenRand32();
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue