Assign self when spawning enemies.
This commit is contained in:
parent
46d9983142
commit
70d1101ded
|
@ -453,7 +453,9 @@ static void spawnEnemies(void)
|
||||||
{
|
{
|
||||||
sprintf(name, "%s%s", world.enemyTypes[r], (rand() % 2 ? "Blob" : "EyeDroid"));
|
sprintf(name, "%s%s", world.enemyTypes[r], (rand() % 2 ? "Blob" : "EyeDroid"));
|
||||||
|
|
||||||
u = (Unit*) createEntity(name);
|
u = (Unit*)createEntity(name);
|
||||||
|
|
||||||
|
self = (Entity*)u;
|
||||||
|
|
||||||
u->animate();
|
u->animate();
|
||||||
|
|
||||||
|
|
|
@ -73,5 +73,6 @@ extern void playMusic(int loop);
|
||||||
extern App app;
|
extern App app;
|
||||||
extern Colors colors;
|
extern Colors colors;
|
||||||
extern Dev dev;
|
extern Dev dev;
|
||||||
|
extern Entity *self;
|
||||||
extern Game game;
|
extern Game game;
|
||||||
extern World world;
|
extern World world;
|
||||||
|
|
Loading…
Reference in New Issue