From e792ee9cbe5191fcc81273b65bdb4ac9108435d5 Mon Sep 17 00:00:00 2001 From: oroborus Date: Sun, 13 Jul 2008 18:45:15 +0000 Subject: - ID manager pocita pocet referencii na ID - oprava chyb, suvisiaca so zlym spravovanim ID - oprava chyby, objekt sa neda pridat mimo priestor ( to uz pisem druhy krat do commnitu ;) ) git-svn-id: http://opensvn.csie.org/tuxanci_ng@127 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/base/item.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/base/item.c') diff --git a/src/base/item.c b/src/base/item.c index ccbdd62..70d6c0e 100644 --- a/src/base/item.c +++ b/src/base/item.c @@ -86,6 +86,11 @@ item_t* newItem(int x, int y, int type, int author_id) #endif new->author_id = author_id; + if( author_id != ID_UNKNOWN ) + { + incID(author_id); + } + switch( type ) { case GUN_DUAL_SIMPLE : @@ -216,6 +221,7 @@ void addNewItem(space_t *spaceItem, int author_id) case 11 : type = BONUS_HIDDEN; break; } + #ifndef PUBLIC_SERVER }while( isSettingItem(type) == FALSE || (getNetTypeGame() == NET_GAME_TYPE_NONE && type == BONUS_HIDDEN) ); @@ -399,7 +405,7 @@ void eventConflictShotWithItem(arena_t *arena) case ITEM_EXPLOSION : case ITEM_BIG_EXPLOSION : - isDelShot = TRUE; + isDelShot = TRUE; break; } } @@ -595,7 +601,14 @@ void eventGiveTuxListItem(tux_t *tux, space_t *spaceItem) void destroyItem(item_t *p) { assert( p != NULL ); + delID(p->id); + + if( p->author_id != ID_UNKNOWN ) + { + delID(p->author_id); + } + free(p); } -- cgit v1.2.3