diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-07-04 20:14:01 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-07-04 20:14:01 +0000 |
| commit | 6d0f440cee1efbf8d7f26cc34399e049c1d3bc8a (patch) | |
| tree | e4c59a461cc6fc54f7413d73483ec6e9b57e409c | |
| parent | 247baf298bf2425fd91297ea18d716e714cb3dc5 (diff) | |
- orava chyby, tux sa zobrazoval na radare aj ked mal bonus neviditelnost
git-svn-id: http://opensvn.csie.org/tuxanci_ng@91 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
| -rw-r--r-- | config.h | 2 | ||||
| -rw-r--r-- | src/base/proto.c | 18 | ||||
| -rw-r--r-- | src/client/radar.c | 9 |
3 files changed, 21 insertions, 8 deletions
@@ -1,4 +1,4 @@ -#define TUXANCI_NG_VERSION "svn90" +#define TUXANCI_NG_VERSION "svn91" #define DESTDIR "/usr/local/" diff --git a/src/base/proto.c b/src/base/proto.c index b109115..9a5cc4b 100644 --- a/src/base/proto.c +++ b/src/base/proto.c @@ -381,12 +381,11 @@ void proto_send_newtux_server(int type, client_t *client, tux_t *tux) } else { - x = tux->x; - y = tux->y; + //x = tux->x; + //y = tux->y; + getTuxProportion(tux, &x, &y, NULL, NULL); } - getTuxProportion(tux, &x, &y, NULL, NULL); - sprintf(msg, "newtux %d %d %d %d %d %d %d %s %d %d %d %d %d %d %d %d %d %d %d\n", tux->id ,x, y, tux->status, tux->position ,tux->frame, tux->score, tux->name, tux->gun, tux->bonus, tux->shot[GUN_SIMPLE], tux->shot[GUN_DUAL_SIMPLE], @@ -440,8 +439,19 @@ void proto_recv_newtux_client(char *msg) addObjectToSpace(getCurrentArena()->spaceTux, tux); } + if( tux->control == TUX_CONTROL_KEYBOARD_RIGHT && + x == TUX_LOCATE_UNKNOWN && y == TUX_LOCATE_UNKNOWN ) + { + getTuxProportion(tux, &x, &y, NULL, NULL); + } + addToRadar(id, x, y, RADAR_TYPE_TUX); + if( tux->bonus == BONUS_HIDDEN ) + { + delFromRadar(id); + } + moveObjectInSpace(getCurrentArena()->spaceTux, tux, x, y); tux->status = status; tux->position = position; diff --git a/src/client/radar.c b/src/client/radar.c index d993d41..45f80a4 100644 --- a/src/client/radar.c +++ b/src/client/radar.c @@ -105,9 +105,12 @@ void drawRadar(arena_t *arena) x = ( ( (float)RADAR_SIZE_X) / ( (float)arena->w ) ) * ( (float)thisRadarItem->x ); y = ( ( (float)RADAR_SIZE_Y) / ( (float)arena->h ) ) * ( (float)thisRadarItem->y ); - drawImage(g_radar, - RADAR_LOCATION_X+1+x, RADAR_LOCATION_Y+1+y, - 2*thisRadarItem->type, RADAR_SIZE_Y+2, 2, 2); + if( x >= 0 && x <= RADAR_SIZE_X && y >= 0 && y <= RADAR_SIZE_Y ) + { + drawImage(g_radar, + RADAR_LOCATION_X+1+x, RADAR_LOCATION_Y+1+y, + 2*thisRadarItem->type, RADAR_SIZE_Y+2, 2, 2); + } } } |