From 35185452d7546ab56aa0040d7c2d68795c3f813f Mon Sep 17 00:00:00 2001 From: oroborus Date: Sun, 6 Apr 2008 17:25:52 +0000 Subject: - synchronizuju sa aj veci - preklady obsahuju aj font a velkost pismen - upravy aby to slo ( po stahnut tejto verzii sa hra musi odinstalovat a znova naonstalovat ) git-svn-id: http://opensvn.csie.org/tuxanci_ng@43 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/item.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/item.c') diff --git a/src/item.c b/src/item.c index 22691e6..373189e 100644 --- a/src/item.c +++ b/src/item.c @@ -76,6 +76,7 @@ item_t* newItem(int x, int y, int type, tux_t *author) new->img = g_item[type]; #endif new->author = author; + new->lastSync = getMyTime(); switch( type ) { @@ -242,9 +243,12 @@ void drawListItem(list_t *listItem) void eventListItem(list_t *listItem) { + my_time_t currentTime; item_t *thisItem; int i; + currentTime = getMyTime(); + assert( listItem != NULL ); for( i = 0 ; i < listItem->count ; i++ ) @@ -252,6 +256,16 @@ 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 ) -- cgit v1.2.3