summaryrefslogtreecommitdiff
path: root/src/proto.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-17 19:15:10 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-17 19:15:10 +0000
commitfadf9365dba24b680db5cb8750c53e264ff1ec27 (patch)
tree23ef9094c47b009ed5c81e6fb517cf88316bb92e /src/proto.c
parent652ce49bba44c885da4891bcae5fb650ef132a73 (diff)
- drobne upravy v kode
git-svn-id: http://opensvn.csie.org/tuxanci_ng@65 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/proto.c')
-rw-r--r--src/proto.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/proto.c b/src/proto.c
index cffde8d..e14db9f 100644
--- a/src/proto.c
+++ b/src/proto.c
@@ -179,6 +179,8 @@ void proto_recv_hello_server(client_t *client, char *msg)
client->tux = newTux();
client->tux->control = TUX_CONTROL_NET;
+ client->tux->client = client;
+
addObjectToSpace(getCurrentArena()->spaceTux, client->tux);
if( strlen(name) > STR_NAME_SIZE-1 )
@@ -451,6 +453,11 @@ void proto_recv_newtux_client(char *msg)
tux = getObjectFromSpaceWithID(getCurrentArena()->spaceTux, id);
+ if( tux != NULL )
+ {
+ assert( tux->id == id );
+ }
+
if( tux == NULL )
{
char term_msg[STR_SIZE];
@@ -458,11 +465,11 @@ void proto_recv_newtux_client(char *msg)
appendTextInTerm(term_msg);
tux = newTux();
+ replaceTuxID(tux, id);
tux->control = TUX_CONTROL_NET;
addObjectToSpace(getCurrentArena()->spaceTux, tux);
}
- replaceTuxID(tux, id);
moveObjectInSpace(getCurrentArena()->spaceTux, tux, x, y);
tux->status = status;
tux->position = position;
@@ -590,7 +597,7 @@ void proto_recv_deltux_client(char *msg)
appendTextInTerm(term_msg);
//index = searchListItem(getCurrentArena()->listTux, tux);
- delObjectFromSpaceWithMem(getCurrentArena()->spaceTux, tux, destroyTux);
+ delObjectFromSpaceWithObject(getCurrentArena()->spaceTux, tux, destroyTux);
}
}