@@ -32,12 +32,12 @@ int main() {
3232 colors [LIGHT_WALL ] = TCOD_color_RGB (130 , 110 , 50 );
3333 colors [LIGHT_GROUND ] = TCOD_color_RGB (200 , 180 , 50 );
3434
35- entity_list * entities_list_head ;
36- entity_list * player ;
37- entities_list_head = (entity_list * ) malloc (sizeof (entity_list ));
35+ struct entity_list * entities_list_head ;
36+ struct entity_list * player ;
37+ entities_list_head = (struct entity_list * ) malloc (sizeof (struct entity_list ));
3838 entities_list_head -> next = NULL ;
3939 player = entities_list_head ;
40- fighter * fighter = create_fighter (30 , 2 , 5 );
40+ struct fighter * fighter = create_fighter (30 , 2 , 5 );
4141 player -> data = create_entity (screen_width / 2 , screen_height / 2 , '@' , TCOD_white , "Player" , true, fighter , NULL );
4242 TCOD_console_set_custom_font ("terminal16x16_gs_ro.png" ,
4343 TCOD_FONT_TYPE_GRAYSCALE | TCOD_FONT_LAYOUT_ASCII_INROW ,
@@ -46,7 +46,7 @@ int main() {
4646 TCOD_console_init_root (screen_width , screen_height , "libtcod Tutorial" , false, TCOD_RENDERER_SDL2 );
4747 TCOD_console_t con = TCOD_console_new (screen_width , screen_height );
4848
49- game_map * map = create_game_map (map_width , map_height );
49+ struct game_map * map = create_game_map (map_width , map_height );
5050 make_map (map , max_rooms , room_min_size , room_max_size , map_width , map_height , player -> data , entities_list_head ,
5151 max_monsters_per_room );
5252
@@ -94,7 +94,7 @@ int main() {
9494 int destination_x = player -> data -> x + dx ;
9595 int destination_y = player -> data -> y + dy ;
9696 if (!is_blocked (map , destination_x , destination_y )) {
97- entity * target = get_blocking_entities_at_location (entities_list_head , destination_x ,
97+ struct entity * target = get_blocking_entities_at_location (entities_list_head , destination_x ,
9898 destination_y );
9999 if (target ) {
100100 printf ("You kick the %s in the shins, much to its annoyance!\n" , target -> name );
@@ -111,10 +111,10 @@ int main() {
111111 }
112112
113113 if (game_state == ENEMY_TURN ) {
114- entity_list * curr = entities_list_head ;
114+ struct entity_list * curr = entities_list_head ;
115115 while (curr != NULL ) {
116116 if (curr -> data -> ai_action ) {
117- (* curr -> data -> ai_action )(curr -> data );
117+ (* curr -> data -> ai_action )(curr -> data , player -> data , fov_map , map , entities_list_head );
118118 }
119119 curr = curr -> next ;
120120 }
0 commit comments