summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/clif.c15
-rw-r--r--src/map/itemdb.c15
-rw-r--r--src/map/map.h1
-rw-r--r--src/map/pc.c11
-rw-r--r--src/map/skill.c7
6 files changed, 27 insertions, 24 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index e74862b77..0e6b19073 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1367,8 +1367,6 @@ static struct Damage battle_calc_weapon_attack(
skillratio += 140+60*skill_lv;
break;
case BA_MUSICALSTRIKE:
- skillratio += 40*skill_lv-40;
- break;
case DC_THROWARROW:
skillratio += 50*skill_lv;
break;
diff --git a/src/map/clif.c b/src/map/clif.c
index 6521dca6c..30e0c1cd1 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1754,9 +1754,6 @@ int clif_changemap(struct map_session_data *sd, short map, int x, int y) {
WFIFOW(fd,20) = y;
WFIFOSET(fd, packet_len_table[0x91]);
- if(pc_isdead(sd)) // If player is dead, and is spawned (such as @refresh) send death packet. [Valaris]
- clif_clearchar_area(&sd->bl,1);
-
return 0;
}
@@ -8061,6 +8058,13 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if(sd->bl.prev != NULL)
return;
+
+ if (sd->state.rewarp)
+ { //Rewarp player.
+ sd->state.rewarp = 0;
+ clif_changemap(sd,sd->mapindex,sd->bl.x,sd->bl.y);
+ return;
+ }
if(sd->npc_id) npc_event_dequeue(sd);
@@ -8240,8 +8244,9 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
else
sd->areanpc_id = 0;
- if (pc_isdead(sd)) //In case you warped dead.
- clif_clearchar_area(&sd->bl, 1);
+ // If player is dead, and is spawned (such as @refresh) send death packet. [Valaris]
+ if(pc_isdead(sd))
+ clif_clearchar_area(&sd->bl,1);
}
/*==========================================
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 7651535f1..80a58a520 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -285,7 +285,6 @@ static int itemdb_ispetequip(struct item_data *data)
}
}
-
/*==========================================
* Trade Restriction functions [Skotlex]
*------------------------------------------
@@ -598,7 +597,7 @@ static int itemdb_read_itemslottable(void)
struct item_data* item;
sscanf(p, "%d#%d#", &nameid, &equip);
item = itemdb_search(nameid);
- if (equip && item && itemdb_isequip2(item))
+ if (equip && item && itemdb_isequip2(item))
item->equip = equip;
p = strchr(p, 10);
if(!p) break;
@@ -1184,12 +1183,18 @@ void itemdb_reload(void)
void do_final_itemdb(void)
{
item_db->destroy(item_db, itemdb_final_sub, 1);
- if (dummy_item.script)
+ if (dummy_item.script) {
script_free_code(dummy_item.script);
- if (dummy_item.equip_script)
+ dummy_item.script = NULL;
+ }
+ if (dummy_item.equip_script) {
script_free_code(dummy_item.equip_script);
- if (dummy_item.unequip_script)
+ dummy_item.equip_script = NULL;
+ }
+ if (dummy_item.unequip_script) {
script_free_code(dummy_item.unequip_script);
+ dummy_item.unequip_script = NULL;
+ }
}
int do_init_itemdb(void)
diff --git a/src/map/map.h b/src/map/map.h
index 116ff25fd..7cdbb00cf 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -493,6 +493,7 @@ struct map_session_data {
unsigned finalsave :1; //Signals whether the final save for the char was done or not yet. Meant to prevent exploits and the like. [Skotlex]
unsigned blockedmove :1;
unsigned using_fake_npc :1;
+ unsigned rewarp :1; //Signals that a player should warp as soon as he is done loading a map. [Skotlex]
unsigned short autoloot;
struct guild *gmaster_flag;
} state;
diff --git a/src/map/pc.c b/src/map/pc.c
index 417aab16f..63d097b14 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -3167,13 +3167,6 @@ int pc_setpos(struct map_session_data *sd,unsigned short mapindex,int x,int y,in
ShowDebug("pc_setpos: Passed mapindex(%d) is invalid!\n", mapindex);
return 1;
}
- if(sd->state.auth && sd->bl.prev == NULL)
- { //Should NOT move a character while it is not in a map (changing between maps, for example)
- //state.auth helps identifies if this is the initial setpos rather than a normal map-change set pos.
- if (battle_config.etc_log)
- ShowInfo("pc_setpos failed: Attempted to relocate player %s (%d:%d) while it is still between maps.\n", sd->status.name, sd->status.account_id, sd->status.char_id);
- return 3;
- }
m=map_mapindex2mapid(mapindex);
@@ -3246,7 +3239,9 @@ int pc_setpos(struct map_session_data *sd,unsigned short mapindex,int x,int y,in
if(sd->status.pet_id > 0 && sd->pd)
unit_remove_map(&sd->pd->bl, clrtype);
clif_changemap(sd,map[m].index,x,y); // [MouseJstr]
- }
+ } else if(sd->state.auth)
+ //Tag player for rewarping after map-loading is done. [Skotlex]
+ sd->state.rewarp = 1;
sd->mapindex = mapindex;
sd->bl.m = m;
diff --git a/src/map/skill.c b/src/map/skill.c
index a07db8ba0..7f460e507 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5085,10 +5085,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
}
sp1 = sstatus->sp;
sp2 = tstatus->sp;
- status_zap(src, 0, sp1);
- status_zap(bl, 0, sp2);
- status_heal(src, 0, sp2, 3);
- status_heal(bl, 0, sp1, 3);
+ //TODO: Will this work correctly once sp1/sp2 go above INT_MAX?
+ status_heal(src, 0, (signed int)(sp2-sp1), 3);
+ status_heal(bl, 0, (signed int)(sp1-sp2), 3);
clif_skill_nodamage(src,bl,skillid,skilllv,1);
}
break;