mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- allow A_M_Refire to be called without state label because this seems to have been used in existing DECORATE mods. This way of calling it will revert to the old behavior of jumping one state forward instead of to a state label.
This commit is contained in:
parent
898e2900b3
commit
40355f6298
2 changed files with 16 additions and 3 deletions
|
@ -3371,6 +3371,17 @@ FxExpression *FxCompareEq::Resolve(FCompileContext& ctx)
|
|||
{
|
||||
Promote(ctx);
|
||||
}
|
||||
// allows comparing state labels with null pointers.
|
||||
else if (left->ValueType == TypeStateLabel && right->ValueType == TypeNullPtr)
|
||||
{
|
||||
right = new FxTypeCast(right, TypeStateLabel, false);
|
||||
SAFE_RESOLVE(right, ctx);
|
||||
}
|
||||
else if (right->ValueType == TypeStateLabel && left->ValueType == TypeNullPtr)
|
||||
{
|
||||
left = new FxTypeCast(left, TypeStateLabel, false);
|
||||
SAFE_RESOLVE(left, ctx);
|
||||
}
|
||||
else if (left->ValueType->GetRegType() == REGT_POINTER && right->ValueType->GetRegType() == REGT_POINTER)
|
||||
{
|
||||
if (left->ValueType != right->ValueType && right->ValueType != TypeNullPtr && left->ValueType != TypeNullPtr &&
|
||||
|
|
|
@ -282,7 +282,7 @@ class ScriptedMarine : Actor
|
|||
//
|
||||
//============================================================================
|
||||
|
||||
void A_M_Refire (bool ignoremissile, statelabel jumpto)
|
||||
void A_M_Refire (bool ignoremissile, statelabel jumpto = null)
|
||||
{
|
||||
if (target == null || target.health <= 0)
|
||||
{
|
||||
|
@ -293,13 +293,15 @@ class ScriptedMarine : Actor
|
|||
return;
|
||||
}
|
||||
}
|
||||
SetStateLabel (jumpto);
|
||||
if (jumpto != null) SetStateLabel (jumpto);
|
||||
else SetState(CurState + 1);
|
||||
return;
|
||||
}
|
||||
if (((ignoremissile || MissileState == null) && !CheckMeleeRange ()) ||
|
||||
!CheckSight (target) || random[SMarineRefire]() < 4) // Small chance of stopping even when target not dead
|
||||
{
|
||||
SetStateLabel (jumpto);
|
||||
if (jumpto != null) SetStateLabel (jumpto);
|
||||
else SetState(CurState + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue