summaryrefslogtreecommitdiff
path: root/src/gun.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-12 16:36:13 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-12 16:36:13 +0000
commit9751218f594526982877332d6ca0fa90b67bbb7b (patch)
tree2acbc70e3d8432bb80ef70470bda75ba93bc2593 /src/gun.c
parent4919e623c6695a80aaf96187253756dcbb72bf87 (diff)
- 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
Diffstat (limited to 'src/gun.c')
-rw-r--r--src/gun.c17
1 files changed, 13 insertions, 4 deletions
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 );
}
}
}