summaryrefslogtreecommitdiff
path: root/src/shot.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-05-04 19:22:36 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-05-04 19:22:36 +0000
commit8b70ac9538f7e4da10666cfc21fd368a91a77ae3 (patch)
tree0157c0b2378e3032fa2357a6e543e3bbab03445c /src/shot.c
parent9058b5c0bfc9a05c9004cfbbcdd3bb85d80ed6fc (diff)
- oprava chyby -> client sa zrutil ak dostal packety "init" a "additem" v opacnom poradi
- oprava chyby -> item a shot ukazoval pointerom na tuxa, to znamenalo, ze ak sa tux odhlasil, tak item a shot ukazoval do uvolnenej pamate - oprava chyby -> exploziu si client pridaval sam, a este prijmal packet od servera, ze sa ma pridat explozia git-svn-id: http://opensvn.csie.org/tuxanci_ng@50 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/shot.c')
-rw-r--r--src/shot.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/shot.c b/src/shot.c
index 17dfa2a..04498c0 100644
--- a/src/shot.c
+++ b/src/shot.c
@@ -55,13 +55,12 @@ void initShot()
isShotInit = TRUE;
}
-shot_t* newShot(int x,int y, int px, int py, int gun, tux_t *author)
+shot_t* newShot(int x,int y, int px, int py, int gun, int author_id)
{
shot_t *new;
+ tux_t *author;
static int last_id = 0;
- assert( author != NULL );
-
new = malloc( sizeof(shot_t) );
memset(new, 0, sizeof(shot_t) );
@@ -71,8 +70,17 @@ shot_t* newShot(int x,int y, int px, int py, int gun, tux_t *author)
new->px = px;
new->py = py;
new->gun = gun;
- new->author = author;
- new->position = author->position;
+ new->author_id = author_id;
+
+ new->position = POSITION_UNKNOWN;
+
+ author = getTuxID(getCurrentArena()->listTux, author_id);
+
+ if( author != NULL )
+ {
+ new->position = author->position;
+ }
+
new->isCanKillAuthor = FALSE;
switch( gun )