From aec5ba5ca31f3d7c895beb658a93c353b2b8d5c1 Mon Sep 17 00:00:00 2001 From: oroborus Date: Sun, 23 Mar 2008 21:38:56 +0000 Subject: - zobratie zbrani/bonusov prebieha na server, a server tuto informaciu posiela clientom - server checkuje, ci ma client spravnu verziu - clientovy, ktory sa neprihlasil do hry prikazom hello, neposiela stavy aku su end, alebo deltux - oprava malej chyby v textfiled - posladna aktivita serveru/clienta zistuje druha strana na zaklade kazdeho prijateho packetu, nie iba podla packetu ping - server posile clientovy pakcety "error " ) nespravny pikaz, veriza, timeout git-svn-id: http://opensvn.csie.org/tuxanci_ng@33 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/gun.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/gun.c') diff --git a/src/gun.c b/src/gun.c index 0768b67..c4e3c90 100644 --- a/src/gun.c +++ b/src/gun.c @@ -11,6 +11,8 @@ #include "myTimer.h" #include "item.h" #include "gun.h" +#include "proto.h" +#include "net_multiplayer.h" #ifndef BUBLIC_SERVER #include "sound.h" @@ -231,6 +233,8 @@ static void putInGunMine(tux_t *tux) if( isFreeSpace(x, y, ITEM_MINE_WIDTH, ITEM_MINE_HEIGHT) ) { + item_t *item; + #ifndef BUBLIC_SERVER char msg[STR_SIZE]; playSound("put_mine", SOUND_GROUP_BASE); @@ -238,8 +242,15 @@ static void putInGunMine(tux_t *tux) appendTextInTerm(msg); #endif - addList(arena->listItem, newItem(x, y, ITEM_MINE, tux) ); + tux->shot[tux->gun]--; + + if( getNetTypeGame() != NET_GAME_TYPE_CLIENT ) + { + item = newItem(x, y, ITEM_MINE, tux); + proto_send_additem_server(PROTO_SEND_ALL, NULL, item); + addList(arena->listItem, item ); + } } } -- cgit v1.2.3