mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-21 19:51:27 +00:00
fixed logic bug with HitFriend and Refire functions.
The old code was essentially ineffective and useless, this is how MBF had it and how it was supposed to be.
This commit is contained in:
parent
3798fd815f
commit
b667b930a3
3 changed files with 15 additions and 3 deletions
|
@ -342,12 +342,16 @@ extend class Actor
|
|||
|
||||
void A_CPosRefire()
|
||||
{
|
||||
if (HitFriend())
|
||||
{
|
||||
SetState(SeeState);
|
||||
return;
|
||||
}
|
||||
// keep firing unless target got out of sight
|
||||
A_FaceTarget();
|
||||
if (Random[CPosRefire](0, 255) >= 40)
|
||||
{
|
||||
if (!target
|
||||
|| HitFriend()
|
||||
|| target.health <= 0
|
||||
|| !CheckSight(target, SF_SEEPASTBLOCKEVERYTHING|SF_SEEPASTSHOOTABLELINES))
|
||||
{
|
||||
|
|
|
@ -73,12 +73,16 @@ extend class Actor
|
|||
{
|
||||
void A_SpidRefire()
|
||||
{
|
||||
if (HitFriend())
|
||||
{
|
||||
SetState(SeeState);
|
||||
return;
|
||||
}
|
||||
// keep firing unless target got out of sight
|
||||
A_FaceTarget();
|
||||
if (Random[CPosRefire](0, 255) >= 10)
|
||||
{
|
||||
if (!target
|
||||
|| HitFriend()
|
||||
|| target.health <= 0
|
||||
|| !CheckSight(target, SF_SEEPASTBLOCKEVERYTHING|SF_SEEPASTSHOOTABLELINES))
|
||||
{
|
||||
|
|
|
@ -164,13 +164,17 @@ extend class Actor
|
|||
void A_SentinelRefire()
|
||||
{
|
||||
A_FaceTarget ();
|
||||
if (HitFriend())
|
||||
{
|
||||
SetState(SeeState);
|
||||
return;
|
||||
}
|
||||
|
||||
if (random[SentinelRefire]() >= 30)
|
||||
{
|
||||
if (target == NULL ||
|
||||
target.health <= 0 ||
|
||||
!CheckSight (target, SF_SEEPASTBLOCKEVERYTHING|SF_SEEPASTSHOOTABLELINES) ||
|
||||
HitFriend() ||
|
||||
(MissileState == NULL && !CheckMeleeRange()) ||
|
||||
random[SentinelRefire]() < 40)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue