From 6f8cef248e1467595a932707eb9a9c53af2e8839 Mon Sep 17 00:00:00 2001 From: oroborus Date: Fri, 30 May 2008 17:03:33 +0000 Subject: - opravene memory leaky pomocou vlagrindu - sietovy protokol je navrhnuty tal aby client odsiselal info o tom, ze obdrzal spravu git-svn-id: http://opensvn.csie.org/tuxanci_ng@57 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/item.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/item.c') diff --git a/src/item.c b/src/item.c index 63e7890..9a05601 100644 --- a/src/item.c +++ b/src/item.c @@ -80,7 +80,6 @@ item_t* newItem(int x, int y, int type, int author_id) new->img = g_item[type]; #endif new->author_id = author_id; - new->lastSync = getMyTime(); switch( type ) { @@ -270,16 +269,6 @@ void eventListItem(list_t *listItem) thisItem = (item_t *)listItem->list[i]; assert( thisItem != NULL ); - if( getNetTypeGame() == NET_GAME_TYPE_CLIENT ) - { - if( currentTime - thisItem->lastSync > ITEM_SYNC_TIMEOUT ) - { - delListItem(listItem, i, destroyItem); - i--; - continue; - } - } - thisItem->count++; if( thisItem->count == ITEM_MAX_COUNT ) @@ -361,7 +350,7 @@ void mineExplosion(list_t *listItem, item_t *item) index = searchListItem(listItem, item); - assert( index != -1 ); + if( index == -1 )return; /* x = ( item->x + item->w/2 ) - ITEM_BIG_EXPLOSION_WIDTH/2; @@ -390,7 +379,6 @@ void mineExplosion(list_t *listItem, item_t *item) delListItem(listItem, index, destroyItem); } - void eventConflictShotWithItem(list_t *listItem, list_t *listShot) { shot_t *thisShot; @@ -532,7 +520,7 @@ int eventGiveTuxItem(tux_t *tux, list_t *listItem, item_t *item) index = searchListItem(listItem, item); - assert( index != -1 ); + if( index == -1 ) return -1; switch( item->type ) { -- cgit v1.2.3