Reply to get_sprite_with_this_brain
If you don't have an account, just leave the password field blank.
I create 11 sprites and kill them using hurt(); in a seperate script (not attached to them).
Then when I do this:
int &alldead = get_sprite_with_this_brain(9, 0);
if (&alldead == 0)
{
say_xy("`3test", 0, 200);
}
nothing happens, even though all sprites did die (at least they look dead, lots of blood and not moving
).
I checked in debug mode and when it gets to the if statement it counts 11 sprites still... so what's wrong? Do I need to set the brains to 0 myself? I thought that happened anyway when it died, at least I can't find any references to it in a normal enemy script.
Then when I do this:
int &alldead = get_sprite_with_this_brain(9, 0);
if (&alldead == 0)
{
say_xy("`3test", 0, 200);
}
nothing happens, even though all sprites did die (at least they look dead, lots of blood and not moving
I checked in debug mode and when it gets to the if statement it counts 11 sprites still... so what's wrong? Do I need to set the brains to 0 myself? I thought that happened anyway when it died, at least I can't find any references to it in a normal enemy script.







