From 8597fdb2662c21b535f089e28821d624dd0414e4 Mon Sep 17 00:00:00 2001 From: skotlex Date: Thu, 18 May 2006 14:11:16 +0000 Subject: - Applied an experimental weather code that should lower bandwidth usage to near-none, which's only disadvantage should be the weather not clearing out until moving to another map (even when the mapflag is removed from the current map). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6639 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/clif.c | 59 ++++++++++++++++++++-------------------------------------- 1 file changed, 20 insertions(+), 39 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index d6e24a83e..95d7c9ceb 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1220,6 +1220,15 @@ static int clif_set0192(int fd, int m, int x, int y, int type) { return 0; } +// new and improved weather display [Valaris] +static void clif_weather_sub(int fd, int id, int type) { + WFIFOHEAD(fd, packet_len_table[0x1f3]); + WFIFOW(fd,0) = 0x1f3; + WFIFOL(fd,2) = id; + WFIFOL(fd,6) = type; + WFIFOSET(fd,packet_len_table[0x1f3]); +} + /*========================================== * *------------------------------------------ @@ -1236,50 +1245,28 @@ static void clif_weather_check(struct map_session_data *sd) { || map[m].flag.rain || map[m].flag.clouds2) { - WFIFOHEAD(fd, packet_len_table[0x7c]); - WFIFOW(fd,0)=0x7c; - WFIFOL(fd,2)=-10; - WFIFOW(fd,6)=0; - WFIFOW(fd,8)=0; - WFIFOW(fd,10)=0; - WFIFOW(fd,12)=OPTION_INVISIBLE; - WFIFOW(fd,20)=100; - WFIFOPOS(fd,36,sd->bl.x,sd->bl.y); - WFIFOSET(fd,packet_len_table[0x7c]); - if (map[m].flag.snow) - clif_weather_sub(fd, 162); + clif_weather_sub(fd, sd->bl.id, 162); if (map[m].flag.clouds) - clif_weather_sub(fd, 233); + clif_weather_sub(fd, sd->bl.id, 233); if (map[m].flag.clouds2) - clif_weather_sub(fd, 516); + clif_weather_sub(fd, sd->bl.id, 516); if (map[m].flag.fog) - clif_weather_sub(fd, 515); + clif_weather_sub(fd, sd->bl.id, 515); if (map[m].flag.fireworks) { - clif_weather_sub(fd, 297); - clif_weather_sub(fd, 299); - clif_weather_sub(fd, 301); + clif_weather_sub(fd, sd->bl.id, 297); + clif_weather_sub(fd, sd->bl.id, 299); + clif_weather_sub(fd, sd->bl.id, 301); } if (map[m].flag.sakura) - clif_weather_sub(fd, 163); + clif_weather_sub(fd, sd->bl.id, 163); if (map[m].flag.leaves) - clif_weather_sub(fd, 333); + clif_weather_sub(fd, sd->bl.id, 333); if (map[m].flag.rain) - clif_weather_sub(fd, 161); + clif_weather_sub(fd, sd->bl.id, 161); } } -// new and improved weather display [Valaris] -int clif_weather_sub(int fd, int type) { - WFIFOHEAD(fd, packet_len_table[0x1f3]); - WFIFOW(fd,0) = 0x1f3; - WFIFOL(fd,2) = -10; - WFIFOL(fd,6) = type; - WFIFOSET(fd,packet_len_table[0x1f3]); - - return 0; -} - int clif_weather(int m) { int i; @@ -1287,12 +1274,6 @@ int clif_weather(int m) { for(i = 0; i < fd_max; i++) { if (session[i] && (sd = session[i]->session_data) != NULL && sd->state.auth && sd->bl.m == m) { - WFIFOHEAD(sd->fd, packet_len_table[0x80]); - WFIFOW(sd->fd,0) = 0x80; - WFIFOL(sd->fd,2) = -10; - WFIFOB(sd->fd,6) = 0; - WFIFOSET(sd->fd,packet_len_table[0x80]); - clif_weather_check(sd); } } @@ -1490,7 +1471,7 @@ int clif_move(struct block_list *bl) { case BL_PC: { TBL_PC *sd = ((TBL_PC*)bl); - clif_movepc(sd); +// clif_movepc(sd); if(sd->state.size==2) // tiny/big players [Valaris] clif_specialeffect(&sd->bl,423,0); else if(sd->state.size==1) -- cgit v1.2.3-70-g09d2