* Hercules merge e587d71

* Fixed typo at 9e8e3cf

Signed-off-by: Cahyadi Ramadhan Togihon <house.bad@gmail.com>
This commit is contained in:
Cahyadi Ramadhan Togihon 2013-11-14 10:32:24 +07:00
parent 0d6aba208e
commit b2d1932e36
2 changed files with 20 additions and 9 deletions

View File

@ -5042,7 +5042,7 @@ void bonus_script_get(int fd) {
} }
/** [Cydh] /** [Cydh]
* Svae bonus_script data(s) to the table * Save bonus_script data(s) to the table
* @param fd * @param fd
*/ */
void bonus_script_save(int fd) { void bonus_script_save(int fd) {

View File

@ -179,6 +179,7 @@ static char map_ip_str[128];
static uint32 map_ip; static uint32 map_ip;
static uint32 bind_ip = INADDR_ANY; static uint32 bind_ip = INADDR_ANY;
static uint16 map_port = 5121; static uint16 map_port = 5121;
static bool clif_ally_only = false;
int map_fd; int map_fd;
static int clif_parse (int fd); static int clif_parse (int fd);
@ -307,7 +308,7 @@ static int clif_send_sub(struct block_list *bl, va_list ap)
break; break;
case AREA_WOSC: case AREA_WOSC:
{ {
if(src_bl->type == BL_PC){ if(src_bl->type == BL_PC) {
struct map_session_data *ssd = (struct map_session_data *)src_bl; struct map_session_data *ssd = (struct map_session_data *)src_bl;
if (ssd && sd->chatID && (sd->chatID == ssd->chatID)) if (ssd && sd->chatID && (sd->chatID == ssd->chatID))
return 0; return 0;
@ -324,6 +325,10 @@ static int clif_send_sub(struct block_list *bl, va_list ap)
if (session[fd] == NULL) if (session[fd] == NULL)
return 0; return 0;
/* unless visible, hold it here */
if (clif_ally_only && !sd->special_state.intravision && battle_check_target(src_bl,&sd->bl,BCT_ENEMY) > 0)
return 0;
WFIFOHEAD(fd, len); WFIFOHEAD(fd, len);
if (WFIFOP(fd,0) == buf) { if (WFIFOP(fd,0) == buf) {
ShowError("WARNING: Invalid use of clif_send function\n"); ShowError("WARNING: Invalid use of clif_send function\n");
@ -1559,6 +1564,10 @@ static void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_
{ {
uint8 buf[128]; uint8 buf[128];
int len; int len;
struct status_change *sc = NULL;
if ((sc = status_get_sc(bl)) && sc->option&(OPTION_HIDE|OPTION_CLOAK|OPTION_INVISIBLE|OPTION_CHASEWALK))
clif_ally_only = true;
len = clif_set_unit_walking(bl,ud,buf); len = clif_set_unit_walking(bl,ud,buf);
clif_send(buf,len,bl,AREA_WOS); clif_send(buf,len,bl,AREA_WOS);
@ -1568,8 +1577,7 @@ static void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_
if(vd->cloth_color) if(vd->cloth_color)
clif_refreshlook(bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,AREA_WOS); clif_refreshlook(bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,AREA_WOS);
switch(bl->type) switch(bl->type) {
{
case BL_PC: case BL_PC:
{ {
TBL_PC *sd = ((TBL_PC*)bl); TBL_PC *sd = ((TBL_PC*)bl);
@ -1590,12 +1598,11 @@ static void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_
} }
break; break;
case BL_PET: case BL_PET:
if( vd->head_bottom ) if(vd->head_bottom) // needed to display pet equip properly
{// needed to display pet equip properly
clif_pet_equip_area((TBL_PET*)bl); clif_pet_equip_area((TBL_PET*)bl);
}
break; break;
} }
clif_ally_only = false;
} }
@ -1607,6 +1614,7 @@ void clif_move(struct unit_data *ud)
unsigned char buf[16]; unsigned char buf[16];
struct view_data* vd; struct view_data* vd;
struct block_list* bl = ud->bl; struct block_list* bl = ud->bl;
struct status_change *sc = NULL;
vd = status_get_viewdata(bl); vd = status_get_viewdata(bl);
if (!vd || vd->class_ == INVISIBLE_CLASS) if (!vd || vd->class_ == INVISIBLE_CLASS)
@ -1626,16 +1634,19 @@ void clif_move(struct unit_data *ud)
return; return;
} }
if ((sc = status_get_sc(bl)) && sc->option&(OPTION_HIDE|OPTION_CLOAK|OPTION_INVISIBLE|OPTION_CHASEWALK))
clif_ally_only = true;
WBUFW(buf,0)=0x86; WBUFW(buf,0)=0x86;
WBUFL(buf,2)=bl->id; WBUFL(buf,2)=bl->id;
WBUFPOS2(buf,6,bl->x,bl->y,ud->to_x,ud->to_y,8,8); WBUFPOS2(buf,6,bl->x,bl->y,ud->to_x,ud->to_y,8,8);
WBUFL(buf,12)=gettick(); WBUFL(buf,12)=gettick();
clif_send(buf, packet_len(0x86), bl, AREA_WOS); clif_send(buf, packet_len(0x86), bl, AREA_WOS);
if (disguised(bl)) if (disguised(bl)) {
{
WBUFL(buf,2)=-bl->id; WBUFL(buf,2)=-bl->id;
clif_send(buf, packet_len(0x86), bl, SELF); clif_send(buf, packet_len(0x86), bl, SELF);
} }
clif_ally_only = false;
} }