diff --git a/src/dusk/rpg/rpg.c b/src/dusk/rpg/rpg.c index 8b5c4d93..be1659e2 100644 --- a/src/dusk/rpg/rpg.c +++ b/src/dusk/rpg/rpg.c @@ -19,6 +19,7 @@ #include "assert/assert.h" #include "save/save.h" #include "error/error.h" +#include "scene/scene.h" #include "ui/rpg/uiemoji.h" #include "rpg/story/storyflag.h" @@ -80,12 +81,17 @@ errorret_t rpgUpdate(void) { // TODO: Do not update if the scene is not the map scene? errorChain(mapUpdate()); - // Update overworld ents. - entity_t *ent = &ENTITIES[0]; - do { - if(ent->type == ENTITY_TYPE_NULL) continue; - entityUpdate(ent); - } while(++ent < &ENTITIES[ENTITY_COUNT]); + // Update overworld ents - only while actually in the overworld. Entities + // (the player among them) keep existing across scene changes, but their + // input/movement/animation logic doesn't make sense to run mid-battle or + // before the initial scene has handed off to the overworld. + if(SCENE.current == SCENE_TYPE_OVERWORLD) { + entity_t *ent = &ENTITIES[0]; + do { + if(ent->type == ENTITY_TYPE_NULL) continue; + entityUpdate(ent); + } while(++ent < &ENTITIES[ENTITY_COUNT]); + } cutsceneSystemUpdate(); errorChain(rpgCameraUpdate());