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/shot.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/base/shot.c') diff --git a/src/base/shot.c b/src/base/shot.c index e0d9dbf..6911d1a 100644 --- a/src/base/shot.c +++ b/src/base/shot.c @@ -70,6 +70,11 @@ shot_t* newShot(int x,int y, int px, int py, int gun, int author_id) new->gun = gun; new->author_id = author_id; + if( author_id != ID_UNKNOWN ) + { + incID(author_id); + } + new->position = POSITION_UNKNOWN; author = getObjectFromSpaceWithID(getCurrentArena()->spaceTux, author_id); @@ -294,18 +299,6 @@ void eventMoveListShot(arena_t *arena) } } -#if 0 -static int myAbs(int n) -{ - return ( n > 0 ? n : -n ); -} - -static int getSppedShot(shot_t *shot) -{ - return ( myAbs(shot->px) > myAbs(shot->py) ? myAbs(shot->px) : myAbs(shot->py) ); -} -#endif - static int isValueInList(list_t *list, int x) { int i; @@ -374,7 +367,14 @@ void checkShotIsInTuxScreen(arena_t *arena) void destroyShot(shot_t *p) { assert( p != NULL ); + delID(p->id); + + if( p->author_id != ID_UNKNOWN ) + { + delID(p->author_id); + } + free(p); } -- cgit v1.2.3