diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 6 | ||||
-rw-r--r-- | src/map/npc.c | 20 | ||||
-rw-r--r-- | src/map/pc.c | 2 |
3 files changed, 13 insertions, 15 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 3c9e697ac..67c85504c 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -7861,7 +7861,11 @@ int clif_charnameack (int fd, struct block_list *bl) if (battle_config.show_mob_info&1)
str_p += sprintf(str_p, "HP: %u/%u | ", md->status.hp, md->status.max_hp);
if (battle_config.show_mob_info&2)
- str_p += sprintf(str_p, "HP: %d%% | ", 100*md->status.hp/md->status.max_hp);
+
+ str_p += sprintf(str_p, "HP: %d%% | ",
+ md->status.max_hp > 10000?
+ md->status.hp/(md->status.max_hp/100):
+ 100*md->status.hp/md->status.max_hp);
//Even thought mobhp ain't a name, we send it as one so the client
//can parse it. [Skotlex]
if (str_p != mobhp) {
diff --git a/src/map/npc.c b/src/map/npc.c index 8e1cfd336..fc93207a8 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2811,7 +2811,9 @@ static int npc_cleanup_sub (struct block_list *bl, va_list ap) { npc_unload((struct npc_data *)bl);
break;
case BL_MOB:
- unit_free(bl,0);
+ //This is used only on reloading npcs, so let's not free spawn-once mobs. [Skotlex]
+ if (((TBL_MOB*)bl)->spawn)
+ unit_free(bl,0);
break;
}
@@ -2903,21 +2905,13 @@ int do_final_npc(void) {
int i;
struct block_list *bl;
- struct npc_data *nd;
- struct mob_data *md;
- struct pet_data *pd;
for (i = START_NPC_NUM; i < npc_id; i++){
if ((bl = map_id2bl(i))){
- if (bl->type == BL_NPC && (nd = (struct npc_data *)bl)){
- npc_unload(nd);
- } else if (bl->type == BL_MOB && (md = (struct mob_data *)bl)){
- if (md->lootitem)
- aFree(md->lootitem);
- aFree(md);
- } else if (bl->type == BL_PET && (pd = (struct pet_data *)bl)){
- aFree(pd);
- }
+ if (bl->type == BL_NPC)
+ npc_unload((struct npc_data *)bl);
+ else if (bl->type&(BL_MOB|BL_PET))
+ unit_free(bl, 0);
}
}
diff --git a/src/map/pc.c b/src/map/pc.c index bd02b1ec3..740bd13b7 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1472,7 +1472,7 @@ int pc_bonus(struct map_session_data *sd,int type,int val) break; case SP_SPEED_ADDRATE: //Stackable increase if(sd->state.lr_flag != 2) - sd->speed_add_rate = sd->speed_add_rate * (100-val)/100; + sd->speed_add_rate -= val; break; case SP_ASPD: //Raw increase // if(sd->state.lr_flag != 2) |