From 9751218f594526982877332d6ca0fa90b67bbb7b Mon Sep 17 00:00:00 2001 From: oroborus Date: Thu, 12 Jun 2008 16:36:13 +0000 Subject: - prva cast prepisu kodu pre pozuivanie space_t a space_t API, ktore je optimalizovany pre ukladanie informacii o objektoch vo velkych mapach. POZOR: nie je vhodne kompilovat ako gameserver ( pre istotu to ani nejde ) // este to msusim doorbit :) git-svn-id: http://opensvn.csie.org/tuxanci_ng@63 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/gun.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/gun.c') diff --git a/src/gun.c b/src/gun.c index 96d0f21..bddeda1 100644 --- a/src/gun.c +++ b/src/gun.c @@ -93,7 +93,16 @@ static void addShotTrivial(tux_t *tux, int x, int y, int px, int py, int gun) if( getNetTypeGame() == NET_GAME_TYPE_SERVER ) { - proto_send_shot_server(PROTO_SEND_ALL, NULL, shot); + client_t *thisClient; + + thisClient = getClientFromTux(tux); + + if( thisClient != NULL ) + { + proto_send_shot_server(PROTO_SEND_ONE, thisClient, shot); + } + + proto_send_shot_server(PROTO_SEND_ALL_SEES_TUX, thisClient, shot); } } @@ -178,7 +187,7 @@ static void timer_addShotTimer(void *p) id = * ((int *)p); free(p); - tux = getTuxID(getCurrentArena()->listTux, id); + tux = getObjectFromSpaceWithID(getCurrentArena()->spaceTux, id); if( tux == NULL )return; @@ -209,7 +218,7 @@ static void timer_addLaserTimer(void *p) id = * ((int *)p); free(p); - tux = getTuxID(getCurrentArena()->listTux, id); + tux = getObjectFromSpaceWithID(getCurrentArena()->spaceTux, id); if( tux == NULL )return; @@ -281,7 +290,7 @@ static void putInGunMine(tux_t *tux) proto_send_additem_server(PROTO_SEND_ALL, NULL, item); } - addList(arena->listItem, item ); + addObjectToSpace(arena->spaceItem, item ); } } } -- cgit v1.2.3