Quote:
|
Originally Posted by Cybnext
this.i is always going to max out because there isn't a break command whenever you find it. So if there are 10 npcs in the level, this.i will always be maxed to 10.
|
The way he set it up before, the condition in his for would break the loop after a suitable npc was found. The problem was that it waited untill the loopcount maxed out if there weren't any npcs with hearts (not to mention it wasn't uneccesarily not straight forward).
Quote:
|
Originally Posted by GoZelda
Perhaps the problem is that your NPC does not has hearts? As far as I heard NPCs do not automatically have hearts...
|
I thought that at first too (that there was some bug in reading hearts when it didn't exist). But after testing, it works as expected.