summaryrefslogtreecommitdiff
path: root/src/base/item.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-07-13 18:45:15 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-07-13 18:45:15 +0000
commite792ee9cbe5191fcc81273b65bdb4ac9108435d5 (patch)
tree2238fccffd4265bccb14d23a958ec2cec8f6a2f1 /src/base/item.c
parentbb15df3f3428df7cd2a4482adebcdaa6fc2f516e (diff)
- 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
Diffstat (limited to 'src/base/item.c')
-rw-r--r--src/base/item.c15
1 files changed, 14 insertions, 1 deletions
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);
}