diff --git a/engines/fullgame/map.c b/engines/fullgame/map.c index 68309a85dd0cd453b2b5f414edf5c931d8c24e7f..5a84c45d4b1604f86b6113c798fd20e282a60fd1 100644 --- a/engines/fullgame/map.c +++ b/engines/fullgame/map.c @@ -21,12 +21,13 @@ void place_player(map *m, int y, int x, direction dir) { m->player_direction = dir; } -void place_entity(map *m, int y, int x, int id, int category, int *stats) { +void place_entity(map *m, int y, int x, int id, int category, int *stats, char display_symbol) { // Creates entity entity * e = malloc(sizeof(entity)); e->id = id; e->category = category; e->stats = stats; + e->display_symbol = display_symbol; // Place it on the map m->entities[coord_idx(y, x)] = e; @@ -36,6 +37,7 @@ entity * create_entity(char type, int id) { entity * i = malloc(sizeof(entity)); i->id = id; i->stats = NULL; + i->display_symbol = type; switch (type) { case '@': i->category = FLAG; break; case 'O': diff --git a/engines/fullgame/map.h b/engines/fullgame/map.h index a593532e851799f0db73b58107bf9125e63356e8..55348999cdb27329fa468ed020cd2a89e7cd3dbf 100644 --- a/engines/fullgame/map.h +++ b/engines/fullgame/map.h @@ -39,6 +39,7 @@ typedef struct Entity { int id; // identifier to display and use in events int category; // used to group in events, like monster, NPC... int *stats; // any property the entity may have (life points, state...) + char display_symbol; // The symbol of the Entity on an ASCII map } entity; typedef struct Map { @@ -71,7 +72,8 @@ int player_idx(void); map *current_map(void); void place_player(map *m, int y, int x, direction dir); -void place_entity(map *m, int y, int x, int id, int category, int *stats); +void place_entity(map *m, int y, int x, int id, int category, int *stats, + char display_symbol); void free_map_stack(void); diff --git a/levels/medium/drift_follow/main.c b/levels/medium/drift_follow/main.c index c63350dd7990c5ebd9b943243ff502883557fa0a..a205ba866613c253941bd7c4a166e447ff3207b5 100644 --- a/levels/medium/drift_follow/main.c +++ b/levels/medium/drift_follow/main.c @@ -54,7 +54,7 @@ int main() { // Init map and entities map * m = create_empty_map("main", 20, 8); place_player(m, 4, 8, UNKNOWN); - place_entity(m, 4, 3, 0, NPC, NULL); + place_entity(m, 4, 3, 0, NPC, NULL, 'P'); init_buffer(&command_buffer);