From d29343c8c01cd977d4f1ff2c04eceb875cdcf7b3 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Sun, 14 Jul 2013 20:54:45 +0200 Subject: [PATCH] use remove_bullets to deal with muzzleflash --- spriteview.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/spriteview.c b/spriteview.c index f3b4f45..6b98541 100644 --- a/spriteview.c +++ b/spriteview.c @@ -1284,6 +1284,7 @@ static void game_tick(int force_redraw) { if(remove_bullets(&go_explosions)) need_redraw = 1; if(remove_bullets(&go_enemy_explosions)) need_redraw = 1; if(remove_bullets(&go_enemy_bullets)) need_redraw = 1; + if(remove_bullets(&go_muzzleflash)) need_redraw = 1; if(remove_explosives(&go_grenades)) need_redraw = 1; if(remove_explosives(&go_enemy_grenades)) need_redraw = 1; if(remove_explosives(&go_rockets)) need_redraw = 1; @@ -1295,14 +1296,7 @@ static void game_tick(int force_redraw) { struct gameobj *go = &objs[i]; obj_visited++; if(go->anim_curr == ANIM_STEP_INIT) need_redraw = 1; - if(go->objtype == OBJ_FLASH) { - if(go->objspecific.bullet.step_curr >= go->objspecific.bullet.step_max) { - gameobj_free(i); - golist_remove(&go_muzzleflash, i); - need_redraw = 1; - continue; - } else go->objspecific.bullet.step_curr++; - } else if (go->objtype == OBJ_ENEMY_SHOOTER || go->objtype == OBJ_ENEMY_BOMBER) { + if(go->objtype == OBJ_ENEMY_SHOOTER || go->objtype == OBJ_ENEMY_BOMBER) { if (tickcounter % 4 == go->anim_frame) { const struct enemy_route *rc = get_enemy_current_route(go->objspecific.enemy.curr_step, go->objspecific.enemy.spawn); if(rc->vel) { -- 2.11.4.GIT