Default function for changeEnvironment.

This commit is contained in:
Steve 2018-02-04 11:24:19 +00:00
parent c4346550cf
commit 7e88125864
3 changed files with 7 additions and 4 deletions

View File

@ -30,6 +30,7 @@ static void die(void);
static void activate(int active); static void activate(int active);
static void touch(Entity *other); static void touch(Entity *other);
static void animate(void); static void animate(void);
static void changeEnvironment(void);
static void load(cJSON *root); static void load(cJSON *root);
static void save(cJSON *root); static void save(cJSON *root);
static SDL_Rect *getCurrentSprite(void); static SDL_Rect *getCurrentSprite(void);
@ -68,6 +69,7 @@ void initEntity(Entity *e)
e->bounce = bounce; e->bounce = bounce;
e->getCurrentSprite = getCurrentSprite; e->getCurrentSprite = getCurrentSprite;
e->die = die; e->die = die;
e->changeEnvironment = changeEnvironment;
e->load = load; e->load = load;
e->save = save; e->save = save;
@ -153,6 +155,10 @@ static void die(void)
self->alive = ALIVE_DEAD; self->alive = ALIVE_DEAD;
} }
static void changeEnvironment(void)
{
}
static SDL_Rect *getCurrentSprite(void) static SDL_Rect *getCurrentSprite(void)
{ {
return &self->sprite[self->facing]->frames[self->spriteFrame]->rect; return &self->sprite[self->facing]->frames[self->spriteFrame]->rect;

View File

@ -27,7 +27,6 @@ extern void addTeleportStars(Entity *e);
extern void initEntity(Entity *e); extern void initEntity(Entity *e);
extern Sprite *getSprite(char *name); extern Sprite *getSprite(char *name);
extern int addItem(Item *i); extern int addItem(Item *i);
extern int numCarriedItems(void);
extern void updateObjective(char *targetName); extern void updateObjective(char *targetName);
extern Entity *self; extern Entity *self;

View File

@ -534,9 +534,7 @@ static void moveToOthers(float dx, float dy, PointF *position)
{ {
hit = 1; hit = 1;
/* /* Infinite loop! Kill it! */
* Infinite loop! Kill it!
*/
if (dx == 0 && dy == 0 && solidLoopHits++ > 1) if (dx == 0 && dy == 0 && solidLoopHits++ > 1)
{ {
self->alive = ALIVE_DEAD; self->alive = ALIVE_DEAD;