diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-08-18 03:22:11 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-08-18 03:22:11 +0000 |
commit | 9cf344e5c49ae0565a3ae228e8ca0126afef547a (patch) | |
tree | 5eedc81e0f9f54b0576be8042e727420a4244aee /src | |
parent | 9c6e1847c77e2cbed53c5a1609423316c366e12c (diff) | |
download | hercules-9cf344e5c49ae0565a3ae228e8ca0126afef547a.tar.gz hercules-9cf344e5c49ae0565a3ae228e8ca0126afef547a.tar.bz2 hercules-9cf344e5c49ae0565a3ae228e8ca0126afef547a.tar.xz hercules-9cf344e5c49ae0565a3ae228e8ca0126afef547a.zip |
- Corrected a bit npc_remove_map, map_deliddb and strdb_remove calls belong to npc_unload rather than npc_remove_map. Also improved a bit the removal of the npc from the map's npc list.
- Added back the hair-style/hair-bottom fields to the spawn packet, and the pet-idle packet is no longer sent when the pet does not has an armor equipped (this should cut down on bandwidth a bit for non-equipped pets)
- Moved the position of the map_addblock/clif_spawn code section in parse_LoadEndAck to above the party-hp blocks, this corrects party-member HP display mnot being updated when someone spawns in your range of sight.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11033 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/clif.c | 23 | ||||
-rw-r--r-- | src/map/npc.c | 6 |
2 files changed, 16 insertions, 13 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index d228ea6f7..724ce0ff0 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1315,11 +1315,13 @@ int clif_spawn(struct block_list *bl) WBUFW(buf,10)=sc->opt2; WBUFW(buf,12)=sc->option; } + WBUFW(buf,14)=vd->hair_style; //14W: Hair Style //16W: Weapon //18W: Head bottom WBUFW(buf,20)=vd->class_; //22W: Shield + WBUFW(buf,24)=vd->head_bottom; //Pet armor //24W: Head top //26W: Head mid //28W: Hair color @@ -1363,6 +1365,7 @@ int clif_spawn(struct block_list *bl) } break; case BL_PET: + if (vd->head_bottom) //Pet armor display fix. { TBL_PET* pd = (TBL_PET*)bl; if (pd->vd.head_bottom) clif_pet_equip(pd); // needed to display pet equip properly @@ -3742,6 +3745,7 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) } break; case BL_PET: + if (vd->head_bottom) //Pet armor display fix. { // needed to display pet equip properly TBL_PET* pd = (TBL_PET*)bl; @@ -7999,6 +8003,16 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) clif_updatestatus(sd,SP_MAXWEIGHT); clif_updatestatus(sd,SP_WEIGHT); + if(battle_config.pc_invincible_time > 0) { + if(map_flag_gvg(sd->bl.m)) + pc_setinvincibletimer(sd,battle_config.pc_invincible_time<<1); + else + pc_setinvincibletimer(sd,battle_config.pc_invincible_time); + } + map_addblock(&sd->bl); // ブロック登録 + clif_spawn(&sd->bl); // spawn + + // Party if(sd->status.party_id) { party_send_movemap(sd); @@ -8009,15 +8023,6 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) if(sd->status.guild_id) guild_send_memberinfoshort(sd,1); - if(battle_config.pc_invincible_time > 0) { - if(map_flag_gvg(sd->bl.m)) - pc_setinvincibletimer(sd,battle_config.pc_invincible_time<<1); - else - pc_setinvincibletimer(sd,battle_config.pc_invincible_time); - } - map_addblock(&sd->bl); // ブロック登録 - clif_spawn(&sd->bl); // spawn - if(map[sd->bl.m].flag.pvp) { if(!battle_config.pk_mode) { // remove pvp stuff for pk_mode [Valaris] if (!map[sd->bl.m].flag.pvp_nocalcrank) diff --git a/src/map/npc.c b/src/map/npc.c index 090a2adc2..b5fc1cacf 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1445,7 +1445,6 @@ int npc_remove_map(struct npc_data* nd) npc_chat_finalize(nd); #endif clif_clearunit_area(&nd->bl,2); - strdb_remove(npcname_db, (nd->bl.subtype < SCRIPT) ? nd->name : nd->exname); //Remove corresponding NPC CELLs if (nd->bl.subtype == WARP) { int j, xs, ys, x, y; @@ -1462,14 +1461,12 @@ int npc_remove_map(struct npc_data* nd) } } map_delblock(&nd->bl); - map_deliddb(&nd->bl); //Remove npc from map[].npc list. [Skotlex] for(i=0;i<map[m].npc_num && map[m].npc[i] != nd;i++); if (i >= map[m].npc_num) return 2; //failed to find it? map[m].npc_num--; - for(; i<map[m].npc_num; i++) - map[m].npc[i]=map[m].npc[i+1]; + memmove(&map[m].npc[i], &map[m].npc[i+1], (map[m].npc_num-i)*sizeof(map[m].npc[0])); return 0; } @@ -1511,6 +1508,7 @@ int npc_unload(struct npc_data* nd) npc_remove_map(nd); map_deliddb(&nd->bl); + strdb_remove(npcname_db, (nd->bl.subtype < SCRIPT) ? nd->name : nd->exname); if (nd->chat_id) // remove npc chatroom object and kick users chat_deletenpcchat(nd); |