summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-07-08 21:17:12 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-07-08 21:17:12 +0000
commit0eda3185ba30d433029c9a7e725529a801c93d80 (patch)
tree3eeed16eb926fc3529f051704fd53070670e7124 /src
parent7386e93e32575bae21006d0300cbff4cf7a40926 (diff)
- do widgetu textfiled sa zmesti IP adresa ( zatial aspon IPv4 )
- v arene je vzdy kostantny pocet zbarni/bonsov ( implicitny je 10, nastavuje sa v configu pomocou ITEM ) - oprava chyby, tux s binusom hidden sa moze teleportovat - oprava chyb v moduloch pipe teleport a wall git-svn-id: http://opensvn.csie.org/tuxanci_ng@125 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src')
-rw-r--r--src/base/item.c4
-rw-r--r--src/base/proto.c9
-rwxr-xr-xsrc/modules/modPipe.c32
-rwxr-xr-xsrc/modules/modTeleport.c37
-rwxr-xr-xsrc/modules/modWall.c8
-rw-r--r--src/server/publicServer.c7
-rw-r--r--src/widget/widget_textfield.c4
-rw-r--r--src/widget/widget_textfield.h2
8 files changed, 39 insertions, 64 deletions
diff --git a/src/base/item.c b/src/base/item.c
index 842da13..ccbdd62 100644
--- a/src/base/item.c
+++ b/src/base/item.c
@@ -582,9 +582,11 @@ void eventGiveTuxListItem(tux_t *tux, space_t *spaceItem)
eventGiveTuxItem(tux, thisItem, spaceItem);
+#ifdef PUBLIC_SERVER
+ addNewItem(spaceItem, ID_UNKNOWN);
+#endif
if( getNetTypeGame() == NET_GAME_TYPE_SERVER )
{
- //proto_send_item_server(PROTO_SEND_ALL, NULL, tux, thisItem);
proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux);
}
}
diff --git a/src/base/proto.c b/src/base/proto.c
index b5f8d39..052a0c4 100644
--- a/src/base/proto.c
+++ b/src/base/proto.c
@@ -382,8 +382,13 @@ void proto_send_newtux_server(int type, client_t *client, tux_t *tux)
}
else
{
- //x = tux->x;
- //y = tux->y;
+ getTuxProportion(tux, &x, &y, NULL, NULL);
+ }
+
+ if( type == PROTO_SEND_ONE &&
+ tux->bonus == BONUS_HIDDEN &&
+ client->tux == tux )
+ {
getTuxProportion(tux, &x, &y, NULL, NULL);
}
diff --git a/src/modules/modPipe.c b/src/modules/modPipe.c
index b535404..efe4230 100755
--- a/src/modules/modPipe.c
+++ b/src/modules/modPipe.c
@@ -258,8 +258,8 @@ static void moveShot(shot_t *shot, int position, int src_x, int src_y,
break;
}
- new_y += shot->px;
- new_y += shot->py;
+ new_x += myAbs(shot->px) * shot->px;
+ new_y += myAbs(shot->py) * shot->py;
moveObjectInSpace(export_fce->fce_getCurrentArena()->spaceShot, shot, new_x, new_y);
@@ -356,12 +356,6 @@ int event()
return 0;
}
-/*
- if( export_fce->fce_getNetTypeGame() == NET_GAME_TYPE_CLIENT )
- {
- return;
- }
-*/
arena = export_fce->fce_getCurrentArena();
for( i = 0 ; i < arena->spaceShot->list->count ; i++ )
@@ -390,25 +384,10 @@ int event()
continue;
}
- if( negPosition( thisShot->position ) == thisPipe->position )
+ if( negPosition( thisShot->position ) == thisPipe->position &&
+ export_fce->fce_getNetTypeGame() != NET_GAME_TYPE_CLIENT )
{
- //moveShotFromPipe(thisShot, thisPipe, listPipe);
-
- if( export_fce->fce_getNetTypeGame() == NET_GAME_TYPE_CLIENT )
- {
- if( thisShot->gun != GUN_BOMBBALL )
- {
- delObjectFromSpaceWithObject(export_fce->fce_getCurrentArena()->spaceShot,
- thisShot, export_fce->fce_destroyShot);
- //delListItem(arena->listShot, i, export_fce->fce_destroyShot);
- i--;
- }
- }
- else
- {
- moveShotFromPipe(thisShot, thisPipe);
- }
-
+ moveShotFromPipe(thisShot, thisPipe);
}
else
{
@@ -416,7 +395,6 @@ int event()
export_fce->fce_getNetTypeGame() != NET_GAME_TYPE_CLIENT )
{
export_fce->fce_boundBombBall(thisShot);
- continue;
}
else
{
diff --git a/src/modules/modTeleport.c b/src/modules/modTeleport.c
index 72b3690..d54bb4c 100755
--- a/src/modules/modTeleport.c
+++ b/src/modules/modTeleport.c
@@ -184,6 +184,7 @@ static int getRandomPosition()
}
assert( ! "Stupid error ! " );
+
return -1; // no warnning
}
@@ -200,8 +201,6 @@ static void teleportTux(tux_t *tux, teleport_t *teleport)
distTeleport = getRandomTeleportBut(spaceTeleport->list, teleport);
- //export_fce->fce_getTuxProportion(tux, &current_x, &current_y, NULL, NULL);
-
switch( tux->position )
{
case TUX_UP :
@@ -237,7 +236,14 @@ static void teleportTux(tux_t *tux, teleport_t *teleport)
#endif
if( export_fce->fce_getNetTypeGame() == NET_GAME_TYPE_SERVER )
{
- export_fce->fce_proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux);
+ if( tux->bonus == BONUS_HIDDEN )
+ {
+ export_fce->fce_proto_send_newtux_server(PROTO_SEND_ONE, (client_t *)tux->client, tux);
+ }
+ else
+ {
+ export_fce->fce_proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux);
+ }
}
}
}
@@ -253,31 +259,6 @@ static int getSppedShot(shot_t *shot)
return ( myAbs(shot->px) > myAbs(shot->py) ? myAbs(shot->px) : myAbs(shot->py) );
}
-/*
-static void transformOnlyLasser(shot_t *shot)
-{
- switch( shot->position )
- {
- case TUX_RIGHT :
- case TUX_LEFT :
- shot->w = GUN_LASSER_HORIZONTAL;
- shot->h = GUN_SHOT_VERTICAL;
-#ifndef PUBLIC_SERVER
- shot->img = g_shot_lasserX;
-#endif
- break;
- case TUX_UP :
- case TUX_DOWN :
- shot->w = GUN_SHOT_VERTICAL;
- shot->h = GUN_LASSER_HORIZONTAL;
-#ifndef PUBLIC_SERVER
- shot->img = g_shot_lasserY;
-#endif
- break;
- }
-}
-*/
-
static void transformShot(shot_t *shot, int position)
{
int speed;
diff --git a/src/modules/modWall.c b/src/modules/modWall.c
index 4544ea9..4030795 100755
--- a/src/modules/modWall.c
+++ b/src/modules/modWall.c
@@ -136,9 +136,13 @@ void eventConflictShotWithWall()
continue;
}
- if( thisShot->gun == GUN_BOMBBALL && export_fce->fce_getNetTypeGame() != NET_GAME_TYPE_CLIENT )
+ if( thisShot->gun == GUN_BOMBBALL)
{
- export_fce->fce_boundBombBall(thisShot);
+ if( export_fce->fce_getNetTypeGame() != NET_GAME_TYPE_CLIENT )
+ {
+ export_fce->fce_boundBombBall(thisShot);
+ }
+
continue;
}
diff --git a/src/server/publicServer.c b/src/server/publicServer.c
index b92056c..b2d86f9 100644
--- a/src/server/publicServer.c
+++ b/src/server/publicServer.c
@@ -196,6 +196,7 @@ static int initPublicServerNetwork()
int initPublicServer()
{
int ret;
+ int i;
initListID();
initModule();
@@ -210,7 +211,11 @@ int initPublicServer()
arena = getArena(arenaId);
setCurrentArena(arena);
- addNewItem(arena->spaceItem, ID_UNKNOWN);
+ for( i = 0 ; i < atoi(getSetting("ITEM", "--item", "10")) ; i++ )
+ {
+ addNewItem(arena->spaceItem, ID_UNKNOWN);
+ }
+
isSignalEnd = FALSE;
ret = initPublicServerNetwork();
diff --git a/src/widget/widget_textfield.c b/src/widget/widget_textfield.c
index 3ea7900..ff6e64a 100644
--- a/src/widget/widget_textfield.c
+++ b/src/widget/widget_textfield.c
@@ -34,12 +34,12 @@ static void drawBackground(widget_textfield_t *p)
if( g_textfield0 == NULL )
{
- g_textfield0 = addImageData("button0.png", IMAGE_ALPHA, "textfiled0", IMAGE_GROUP_BASE);
+ g_textfield0 = addImageData("textfield0.png", IMAGE_ALPHA, "textfiled0", IMAGE_GROUP_BASE);
}
if( g_textfield1 == NULL )
{
- g_textfield1 = addImageData("button1.png", IMAGE_ALPHA, "textfiled1", IMAGE_GROUP_BASE);
+ g_textfield1 = addImageData("textfield1.png", IMAGE_ALPHA, "textfiled1", IMAGE_GROUP_BASE);
}
if( p->active )
diff --git a/src/widget/widget_textfield.h b/src/widget/widget_textfield.h
index 0de3c96..11b135c 100644
--- a/src/widget/widget_textfield.h
+++ b/src/widget/widget_textfield.h
@@ -5,7 +5,7 @@
#include "main.h"
-#define WIDGET_TEXTFIELD_WIDTH 125
+#define WIDGET_TEXTFIELD_WIDTH 175
#define WIDGET_TEXTFIELD_HEIGHT 36
#define WIDGET_TEXTFIELD_TEXT_OFFSET_X 10