Index: proj/include/ent.h
===================================================================
--- proj/include/ent.h	(revision 235)
+++ proj/include/ent.h	(revision 236)
@@ -16,7 +16,7 @@
 gunner_t* (gunner_ctor)(basic_sprite_t *dude, basic_sprite_t *weapon);
 void      (gunner_dtor)(gunner_t *p);
 void (gunner_set_pos)               (gunner_t *p, double x, double y);
-void  (gunner_set_spawn)        (gunner_t *p, double x, double y);
+void (gunner_set_spawn)             (gunner_t *p, double x, double y);
 void (gunner_set_angle)             (gunner_t *p, double angle      );
 void (gunner_set_health)            (gunner_t *p, int health);
 void (gunner_set_curr_health)       (gunner_t *p, int health);
@@ -34,7 +34,7 @@
 
 struct bullet;
 typedef struct bullet bullet_t;
-bullet_t* (bullet_ctor)(basic_sprite_t *b, double x, double y, double vx, double vy);
+bullet_t* (bullet_ctor)(const gunner_t *shooter, basic_sprite_t *b, double x, double y, double vx, double vy);
 void      (bullet_dtor)(bullet_t *p);
 double  (bullet_get_x)       (const bullet_t *p);
 double  (bullet_get_y)       (const bullet_t *p);
Index: proj/include/proj_func.h
===================================================================
--- proj/include/proj_func.h	(revision 235)
+++ proj/include/proj_func.h	(revision 236)
@@ -36,7 +36,7 @@
 
 void (shoot_bullet)(const gunner_t *shooter, list_t *bullet_list);
 
-void (update_game_state)(const map_t *map, gunner_t *shooter, list_t *bullet_list);
+void (update_game_state)(const map_t *map, list_t *shooter_list, list_t *bullet_list);
 
 void update_scale(void);
 
Index: proj/src/ent.c
===================================================================
--- proj/src/ent.c	(revision 235)
+++ proj/src/ent.c	(revision 236)
@@ -101,14 +101,16 @@
 }
 
 struct bullet{
+    const gunner_t *shooter;
     double x, y; //real position
     double vx, vy;
     sprite_t *b;
     int damage;
 };
-bullet_t* (bullet_ctor)(basic_sprite_t *b, double x, double y, double vx, double vy){
+bullet_t* (bullet_ctor)(const gunner_t *shooter, basic_sprite_t *b, double x, double y, double vx, double vy){
     bullet_t *ret = malloc(sizeof(bullet_t));
     if(ret == NULL) return NULL;
+    ret->shooter = shooter;
     ret-> x =  x;
     ret-> y =  y;
     ret->vx = vx;
@@ -246,6 +248,8 @@
 }
 
 int (gunner_collides_bullet)(const gunner_t *shooter, const bullet_t *bull){
+    if(bull->shooter == shooter) return false;
+
     double shooter_radius = max(sprite_get_w(shooter->dude), sprite_get_h(shooter->dude))/2.0;
     double shooter_x = gunner_get_x(shooter);
     double shooter_y = gunner_get_y(shooter);
Index: proj/src/proj.c
===================================================================
--- proj/src/proj.c	(revision 235)
+++ proj/src/proj.c	(revision 236)
@@ -54,6 +54,7 @@
     int r;
 
     #ifdef DIOGO
+        /*
         uint8_t conf;
         if((r = util_sys_inb(0x3F8+3, &conf))) return 1; //printf("0x%02X\n", conf);
         conf = 0x19; //00011001
@@ -60,6 +61,7 @@
         //printf("0x%02X\n", conf);
         if((r = sys_outb(0x3F8+3, conf))) return 1;
         if((r = util_sys_inb(0x3F8+3, &conf))) return 1; //printf("0x%02X\n", conf);
+        */
     #endif
 
     font_t *consolas = font_ctor("/home/lcom/labs/proj/media/font/Consolas/xpm2");
@@ -177,6 +179,8 @@
     #ifdef TELMO
         ent_set_scale(DEFAULT_SCALE);
 
+        list_t *shooter_list = list_ctor();
+
         gunner_t *shooter1 = gunner_ctor(bsp_shooter, bsp_pistol); if(shooter1 == NULL) printf("Failed to get shooter1\n");
         gunner_set_spawn(shooter1, 75, 75);
         gunner_set_pos(shooter1, 75, 75);
@@ -185,9 +189,12 @@
         gunner_set_spawn(shooter2, 975, 75);
         gunner_set_pos(shooter2, 775, 75);
 
+        list_insert(shooter_list, list_end(shooter_list), shooter1);
+        list_insert(shooter_list, list_end(shooter_list), shooter2);
+
         //bullet_t *bullet = bullet_ctor(get_bullet(), 400.0, 400.0, 2.0, -1.0);
 
-        list_t *bullet_list = list_ctor();
+        list_t *bullet_list  = list_ctor();
 
         ent_set_origin(gunner_get_x(shooter1)-ent_get_XLength()/2.0,
                        gunner_get_y(shooter1)-ent_get_YLength()/2.0);
@@ -227,7 +234,7 @@
 
                                     if (no_interrupts % 180 == 0) gunner_set_pos(shooter2, 775, 75);
 
-                                    update_game_state(map1, shooter2, bullet_list);
+                                    update_game_state(map1, shooter_list, bullet_list);
 
                                     if(map_collides_gunner(map1, shooter1)){
                                         printf("COLLIDING\n");
@@ -288,12 +295,17 @@
     }
 
     #ifdef TELMO
-        gunner_dtor(shooter1); shooter1 = NULL;
-        gunner_dtor(shooter2); shooter2 = NULL;
+        //gunner_dtor(shooter1); shooter1 = NULL;
+        //gunner_dtor(shooter2); shooter2 = NULL;
 
+        while(list_size(shooter_list) > 0){
+            gunner_t *p = list_erase(shooter_list, list_begin(shooter_list));
+            gunner_dtor(p);
+        }
+
         while(list_size(bullet_list) > 0){
             bullet_t *p = (bullet_t*)list_erase(bullet_list, list_begin(bullet_list));
-            free(p);
+            bullet_dtor(p);
         }
         if(list_dtor(bullet_list)) printf("COULD NOT DESTRUCT BULLET LIST\n");
     #endif
Index: proj/src/proj_func.c
===================================================================
--- proj/src/proj_func.c	(revision 235)
+++ proj/src/proj_func.c	(revision 236)
@@ -70,40 +70,49 @@
     double angle = gunner_get_angle(shooter);
     double vx = -BULLET_SPEED * fm_sin(angle);
     double vy = -BULLET_SPEED * fm_cos(angle);
-    bullet_t *bullet = bullet_ctor(get_bullet(), gunner_get_x(shooter), gunner_get_y(shooter), vx, vy);
+    bullet_t *bullet = bullet_ctor(shooter, get_bullet(), gunner_get_x(shooter), gunner_get_y(shooter), vx, vy);
     list_insert(bullet_list, list_end(bullet_list), bullet);
 }
 
-void (update_game_state)(const map_t *map, gunner_t *shooter, list_t *bullet_list) {
+void (update_game_state)(const map_t *map, list_t *shooter_list, list_t *bullet_list) {
 
     bullet_update_movement_list(bullet_list);
 
-    list_node_t *it = list_begin(bullet_list);
-    while (it != list_end(bullet_list)) {
-        bullet_t *bullet = *(bullet_t**)list_node_val(it);
+    list_node_t *bullet_it = list_begin(bullet_list);
+    while (bullet_it != list_end(bullet_list)) {
+        /// Collision with walls
+        bullet_t *bullet = *(bullet_t**)list_node_val(bullet_it);
         if (map_collides_bullet(map, bullet)) {
-            list_node_t *aux = list_node_next(it);
-            bullet = (bullet_t*)list_erase(bullet_list, it);
-            free(bullet);
-            it = aux;
+            list_node_t *aux = list_node_next(bullet_it);
+            /// Delete bullet
+            bullet_dtor(list_erase(bullet_list, bullet_it));
+            /// Advance iterator
+            bullet_it = aux;
             continue;
         }
-
-        if (gunner_collides_bullet(shooter, bullet)) {
-            list_node_t *aux = list_node_next(it);
-            bullet = (bullet_t*)list_erase(bullet_list, it);
-            gunner_set_curr_health(shooter, gunner_get_curr_health(shooter) - bullet_get_damage(bullet));
-            if (gunner_get_curr_health(shooter) <= 0) {
-                gunner_set_curr_health(shooter, gunner_get_health(shooter));
-                gunner_set_pos(shooter, gunner_get_spawn_x(shooter), gunner_get_spawn_y(shooter));
-            }
-
-            free(bullet);
-            it = aux;
-            continue;
+        /// Collision with shooters
+        list_node_t *shooter_it = list_begin(shooter_list);
+        int deleted_bullet = false;
+        while(shooter_it != list_end(shooter_list)){
+            gunner_t *shooter = *(gunner_t**)list_node_val(shooter_it);
+            if(gunner_collides_bullet(shooter, bullet)) {
+                list_node_t *aux = list_node_next(bullet_it);
+                /// Change health
+                gunner_set_curr_health(shooter, gunner_get_curr_health(shooter) - bullet_get_damage(bullet));
+                if (gunner_get_curr_health(shooter) <= 0) {
+                    shooter = list_erase(shooter_list, shooter_it);
+                    gunner_dtor(shooter);
+                }
+                /// Delete bullet
+                bullet_dtor(list_erase(bullet_list, bullet_it)); deleted_bullet = true;
+                /// Advance iterator
+                bullet_it = aux;
+                break;
+            } else shooter_it = list_node_next(shooter_it);
         }
-
-        it = list_node_next(it);
+        if(deleted_bullet) continue;
+        /// Advance iterator if necessary
+        bullet_it = list_node_next(bullet_it);
     }
 }
 
