Skip to content

compare_sprite_script

Prototypeint compare_sprite_script(int active_sprite, string script[9])

compare_sprite_script() returns '1' if active_sprite is attached to a script named script.

This command was used several times in the original game in a hit() procedure to tell if sprite was hit by a bomb.

c
// Excerpt from s4-rock.s
void hit( void )
{
    int &rcrap = compare_sprite_script(&missle_source, "dam-bomn");
    if (&rcrap == 1)
    {
        //rock just got hit by a sprite with a script named dam-bomn, I'm
        //gonna guess it was the bomb.
    }
}