diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-18 14:11:16 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-18 14:11:16 +0000 |
commit | 8597fdb2662c21b535f089e28821d624dd0414e4 (patch) | |
tree | 01b54bf54e52cf36961d51ee6f948e2b7e76ee4e /src/map | |
parent | 129beea8f2c3b35af17332b451f9f9d4c233af5e (diff) | |
download | hercules-8597fdb2662c21b535f089e28821d624dd0414e4.tar.gz hercules-8597fdb2662c21b535f089e28821d624dd0414e4.tar.bz2 hercules-8597fdb2662c21b535f089e28821d624dd0414e4.tar.xz hercules-8597fdb2662c21b535f089e28821d624dd0414e4.zip |
- 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
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 59 | ||||
-rw-r--r-- | src/map/clif.h | 1 |
2 files changed, 20 insertions, 40 deletions
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)
diff --git a/src/map/clif.h b/src/map/clif.h index 387f5f3c8..621dc28d4 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -308,7 +308,6 @@ void clif_friendslist_reqack(struct map_session_data *sd, struct map_session_dat // [Valaris]
int clif_mob_hp(struct mob_data *md);
-int clif_weather_sub(int fd, int type); // [Valaris]
int clif_weather(int m); // [Valaris]
int clif_specialeffect(struct block_list *bl,int type, int flag); // special effects [Valaris]
int clif_message(struct block_list *bl, char* msg); // messages (from mobs/npcs) [Valaris]
|