MTrop / DoomTools

Doom-related tools for Java. Home of DECOHack and lots of other utilities. Build WAD projects (and soon, other kinds) with ease!
https://mtrop.github.io/DoomTools/
MIT License
45 stars 5 forks source link

[DECOHack] State Search Enters an Endless Loop if Start Index is 0 and No Free States #26

Closed MTrop closed 3 years ago

MTrop commented 3 years ago

(via floatRand) What the title says. Affects three functions in AbstractPatchContext:

MTrop commented 3 years ago

Some code that replicates the issue (there's a missing duration in "death", but that shouldn't affect the result, if fixed):

using mbf21

thing 151 "Cybruiser"
{
    EdNum 101

    Health 600
    Speed 8
    Radius 24
    Damage 16
    Height 64
    ReactionTime 8
    PainChance 40
    Mass 1500

    clear flags
    +SOLID
    +SHOOTABLE
    +COUNTKILL
    +NORADIUSDMG

    states
    {
        Spawn:
            SP01 AB 10 A_Look
            Loop
        See:
            SP01 A 3 A_Chase
            SP01 A 3 A_Metal
            SP01 BBC 3 A_Chase
            SP01 C 3 A_Metal
            SP01 DD 3 A_Chase
            Loop 
        Missile:
            SP01 E 12 A_FaceTarget
            SP01 F 4 Bright A_CyberAttack //todo: replace with another projectile, make attack twice?
            SP01 E 8
            Goto See
        Melee:
            SP01 G 8 A_FaceTarget
            SP01 H 6
            SP01 I 8 A_SkelFist //todo: replace with generic melee attack
            Goto See
        Pain:
            SP01 J 16 A_Pain    
            Goto See
        Death:
            SP01 J 6 A_Scream
            SP01 K 6
            SP01 L 6 A_Fall
            SP01 MNO 6 Bright
            SP01 PQRS
            SP01 T -1 
            Stop
    }
}
MTrop commented 3 years ago

Fixed in commit 3e56203c0da255296d54856323f296b5b9d0c0d9