Project

General

Profile

Revision 305

working on zombies

View differences:

proj_func.c
130 130
        /// Advance iterator if necessary
131 131
        bullet_it = list_node_next(bullet_it);
132 132
    }
133
    /// MEELEE
133
    /// MELEE
134 134
    list_node_t *it1 = list_begin(shooter_list);
135 135
    while(it1 != list_end(shooter_list)){
136 136
        gunner_t *s1 = *list_node_val(it1);
137
        if(gunner_get_type(s1) != gunner_meelee){ it1 = list_node_next(it1); continue; }
137
        if(!(gunner_get_type(s1) & gunner_melee)){ it1 = list_node_next(it1); continue; }
138 138
        list_node_t *it2 = list_begin(shooter_list);
139 139
        while(it2 != list_end(shooter_list)){
140 140
            gunner_t *s2 = *list_node_val(it2);
141
            if(s1 != s2 && gunner_distance(s1, s2) < MEELEE_RANGE)
142
                gunner_set_curr_health(s2, gunner_get_curr_health(s2) - MEELEE_DAMAGE);
141
            if(s1 != s2 && gunner_distance(s1, s2) < MELEE_RANGE)
142
                gunner_set_curr_health(s2, gunner_get_curr_health(s2) - MELEE_DAMAGE);
143 143
            if(gunner_get_curr_health(s2) <= 0){
144 144
                list_node_t *aux = list_node_next(it2);
145 145
                gunner_dtor(list_erase(shooter_list, it2));

Also available in: Unified diff