summaryrefslogtreecommitdiff
path: root/src/base/shot.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/shot.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/shot.c')
-rw-r--r--src/base/shot.c24
1 files changed, 12 insertions, 12 deletions
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);
}