From 1f7f0b8da7a868b40c23f034c75bce46713c5c32 Mon Sep 17 00:00:00 2001 From: oroborus Date: Fri, 18 Apr 2008 20:57:12 +0000 Subject: - ide to skompilovat :) - oprava chyby, pri strele do miny zmiznu _vsetky_ streli - ide to aj (na/od)instalovat :)) git-svn-id: http://opensvn.csie.org/tuxanci_ng@47 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/item.c | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) (limited to 'src/item.c') diff --git a/src/item.c b/src/item.c index 38490f9..c336cd4 100644 --- a/src/item.c +++ b/src/item.c @@ -375,8 +375,9 @@ void eventConflictShotWithItem(list_t *listItem, list_t *listShot) for( i = 0 ; i < listShot->count ; i++ ) { - bool_t isDelShot = FALSE; + bool_t isDelShot; + isDelShot = FALSE; thisShot = (shot_t *)listShot->list[i]; assert( thisShot != NULL ); @@ -385,33 +386,37 @@ void eventConflictShotWithItem(list_t *listItem, list_t *listShot) thisItem = (item_t *)listItem->list[j]; assert( thisItem != NULL ); - switch( thisItem->type ) + if( conflictSpace(thisShot->x, thisShot->y, thisShot->w, thisShot->h, + thisItem->x, thisItem->y, thisItem->w, thisItem->h) ) { - case ITEM_MINE : - - if( getNetTypeGame() != NET_GAME_TYPE_CLIENT && - conflictSpace(thisShot->x, thisShot->y, thisShot->w, thisShot->h, - thisItem->x, thisItem->y, thisItem->w, thisItem->h) ) - { - if( getNetTypeGame() == NET_GAME_TYPE_SERVER ) + switch( thisItem->type ) + { + case ITEM_MINE : + + if( getNetTypeGame() != NET_GAME_TYPE_CLIENT ) { - proto_send_item_server(PROTO_SEND_ALL, NULL, NULL, thisItem); + if( getNetTypeGame() == NET_GAME_TYPE_SERVER ) + { + proto_send_item_server(PROTO_SEND_ALL, NULL, NULL, thisItem); + } + + mineExplosion(listItem, thisItem); + j--; } - - mineExplosion(listItem, thisItem); - j--; - } - break; - - case ITEM_EXPLOSION : - case ITEM_BIG_EXPLOSION : - isDelShot = TRUE; - break; + break; + + case ITEM_EXPLOSION : + case ITEM_BIG_EXPLOSION : + isDelShot = TRUE; + + break; + } } } if( isDelShot ) { + printf("del shot\n"); delListItem(listShot, i, destroyShot); i--; } -- cgit v1.2.3