summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-09-10 20:50:55 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-09-10 20:50:55 +0000
commit8921a3023de5519f0e0af164d71023914c8656f3 (patch)
tree20ac266e3da2e1482954b9895e3c5389ab2927e8 /src/map/clif.c
parentc62e4ce22fe01f8f355f8f47695da2c977102c1c (diff)
downloadhercules-8921a3023de5519f0e0af164d71023914c8656f3.tar.gz
hercules-8921a3023de5519f0e0af164d71023914c8656f3.tar.bz2
hercules-8921a3023de5519f0e0af164d71023914c8656f3.tar.xz
hercules-8921a3023de5519f0e0af164d71023914c8656f3.zip
* Added a safeguard to skill_get_unit_layout() against incorrectly defined layout ids (will give weird results but won't crash at least)
* Fixed Firewall/Icewall being oriented backwards (no real difference though...) * Removed some junk Landprotector/Graffiti code; Graffiti doesn't get placed randomly anymore * Icewall can now be cast on yourself... but for some reason, the cell on yourself immediately expires! * Merged together functions clif_set0192() and clif_changemapcell() - also removed its "send to whole map" mode which is just plain wrong (although aegis actually does use it to 'inform' caster about changes) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11175 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c69
1 files changed, 31 insertions, 38 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 16b6f19f0..d95495c1a 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -640,7 +640,7 @@ int clif_clearflooritem(struct flooritem_data *fitem, int fd)
clif_send(buf, packet_len(0xa1), &fitem->bl, AREA);
} else {
WFIFOHEAD(fd,packet_len(0xa1));
- memcpy(WFIFOP(fd,0), buf, 6);
+ memcpy(WFIFOP(fd,0), buf, packet_len(0xa1));
WFIFOSET(fd,packet_len(0xa1));
}
@@ -1184,20 +1184,6 @@ static void clif_spiritball_single(int fd, struct map_session_data *sd)
WFIFOSET(fd, packet_len(0x1e1));
}
-/*==========================================
- *
- *------------------------------------------*/
-static void clif_set0192(int fd, int m, int x, int y, int type)
-{
- WFIFOHEAD(fd,packet_len(0x192));
- WFIFOW(fd,0) = 0x192;
- WFIFOW(fd,2) = x;
- WFIFOW(fd,4) = y;
- WFIFOW(fd,6) = type;
- mapindex_getmapname_ext(map[m].name, (char*)WFIFOP(fd,8));
- WFIFOSET(fd,packet_len(0x192));
-}
-
// new and improved weather display [Valaris]
static void clif_weather_sub(int fd, int id, int type)
{
@@ -3908,6 +3894,33 @@ void clif_standing(struct block_list* bl)
/*==========================================
*
*------------------------------------------*/
+void clif_changemapcell(int fd, short m, short x, short y, int type)
+{
+ unsigned char buf[32];
+
+ WBUFW(buf,0) = 0x192;
+ WBUFW(buf,2) = x;
+ WBUFW(buf,4) = y;
+ WBUFW(buf,6) = type;
+ mapindex_getmapname_ext(map[m].name,(char*)WBUFP(buf,8));
+
+ if (fd == 0) {
+ struct block_list bl;
+ bl.type = BL_NUL;
+ bl.m = m;
+ bl.x = x;
+ bl.y = y;
+ clif_send(buf,packet_len(0x192),&bl,AREA);
+ } else {
+ WFIFOHEAD(fd,packet_len(0x192));
+ memcpy(WFIFOP(fd,0), buf, packet_len(0x192));
+ WFIFOSET(fd,packet_len(0x192));
+ }
+}
+
+/*==========================================
+ *
+ *------------------------------------------*/
void clif_getareachar_item(struct map_session_data* sd,struct flooritem_data* fitem)
{
int view,fd;
@@ -3948,7 +3961,7 @@ int clif_getareachar_skillunit(struct map_session_data *sd,struct skill_unit *un
WFIFOL(fd, 2)=unit->bl.id;
WFIFOL(fd, 6)=unit->group->src_id;
WFIFOW(fd,10)=unit->bl.x;
- WFIFOW(fd,12)=unit->bl.y; // might be typo? [Lance]
+ WFIFOW(fd,12)=unit->bl.y;
WFIFOB(fd,14)=unit->group->unit_id;
WFIFOB(fd,15)=1;
WFIFOB(fd,16)=1;
@@ -3973,7 +3986,7 @@ int clif_getareachar_skillunit(struct map_session_data *sd,struct skill_unit *un
WFIFOSET(fd,packet_len(0x11f));
if(unit->group->skill_id == WZ_ICEWALL)
- clif_set0192(fd,unit->bl.m,unit->bl.x,unit->bl.y,5);
+ clif_changemapcell(fd,unit->bl.m,unit->bl.x,unit->bl.y,5);
return 0;
/* Previous implementation guess of packet 0x1c9, who can understand what all those fields are for? [Skotlex]
WFIFOHEAD(fd,packet_len(0x1c9));
@@ -4034,7 +4047,7 @@ int clif_clearchar_skillunit(struct skill_unit *unit,int fd)
WFIFOL(fd, 2)=unit->bl.id;
WFIFOSET(fd,packet_len(0x120));
if(unit->group && unit->group->skill_id == WZ_ICEWALL)
- clif_set0192(fd,unit->bl.m,unit->bl.x,unit->bl.y,unit->val2);
+ clif_changemapcell(fd,unit->bl.m,unit->bl.x,unit->bl.y,unit->val2);
return 0;
}
@@ -6355,26 +6368,6 @@ int clif_bladestop(struct block_list *src,struct block_list *dst,
}
/*==========================================
- *
- *------------------------------------------*/
-void clif_changemapcell(short m, short x, short y, int cell_type, int type)
-{
- struct block_list bl;
- unsigned char buf[32];
-
- bl.type = BL_NUL;
- bl.m = m;
- bl.x = x;
- bl.y = y;
- WBUFW(buf,0) = 0x192;
- WBUFW(buf,2) = x;
- WBUFW(buf,4) = y;
- WBUFW(buf,6) = cell_type;
- mapindex_getmapname_ext(map[m].name,(char*)WBUFP(buf,8));
- clif_send(buf,packet_len(0x192),&bl,(!type)?AREA:ALL_SAMEMAP);
-}
-
-/*==========================================
* MVPエフェクト
*------------------------------------------*/
int clif_mvp_effect(struct map_session_data *sd)