summaryrefslogtreecommitdiff
path: root/src/base/shot.c
diff options
context:
space:
mode:
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);
}