summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt3
-rw-r--r--src/map/battle.c3
-rw-r--r--src/map/clif.c10
-rw-r--r--src/map/npc.c4
4 files changed, 12 insertions, 8 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 976f66852..7c6888116 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,9 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/04/29
+ * Clones can't be class-changed now [Skotlex]
+ * Readded the class == -1 distance check in npc_checknear [Skotlex]
+ * Replaced check sd->trade_partner for sd->state.trading in clif.c [Skotlex]
* Using malloc for memory allocations that doesn't need to be pre-initialized.
* Eliminated initializations for pointers returned by calloc.
* Moved grfio_final to do_init since it's not used after server boot.
diff --git a/src/map/battle.c b/src/map/battle.c
index 16132afab..15dabe24d 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -2226,7 +2226,8 @@ static struct Damage battle_calc_weapon_attack(
}
}
- if(sd && sd->classchange && tmd && !(t_mode&MD_BOSS) && !tmd->guardian_data && (tmd->class_ < 1324 || tmd->class_ > 1363) && (rand()%10000 < sd->classchange))
+ if(sd && sd->classchange && tmd && !(t_mode&MD_BOSS) && !tmd->guardian_data && (tmd->class_ < 1324 || tmd->class_ > 1363)
+ && !mob_is_clone(tmd->class_) && (rand()%10000 < sd->classchange))
{ //Classchange:
struct mob_db *mob;
int k, class_;
diff --git a/src/map/clif.c b/src/map/clif.c
index 849db4008..08bfd598c 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9113,7 +9113,7 @@ void clif_parse_NpcClicked(int fd,struct map_session_data *sd)
void clif_parse_NpcBuySellSelected(int fd,struct map_session_data *sd)
{
RFIFOHEAD(fd);
- if (sd->trade_partner != 0)
+ if (sd->state.trading)
return;
npc_buysellsel(sd,RFIFOL(fd,2),RFIFOB(fd,6));
}
@@ -9133,7 +9133,7 @@ void clif_parse_NpcBuyListSend(int fd,struct map_session_data *sd)
n = (RFIFOW(fd,2)-4) /4;
item_list = (unsigned short*)RFIFOP(fd,4);
- if (sd->trade_partner || !sd->npc_shopid){
+ if (sd->state.trading|| !sd->npc_shopid){
fail = 1;
}else{
if((nd = ((struct npc_data *)map_id2bl(sd->npc_shopid))->master_nd)){
@@ -9171,7 +9171,7 @@ void clif_parse_NpcSellListSend(int fd,struct map_session_data *sd)
n = (RFIFOW(fd,2)-4) /4;
item_list = (unsigned short*)RFIFOP(fd,4);
- if (sd->trade_partner || !sd->npc_shopid){
+ if (sd->state.trading|| !sd->npc_shopid){
fail = 1;
}else{
if((nd = ((struct npc_data *)map_id2bl(sd->npc_shopid))->master_nd)){
@@ -9787,7 +9787,7 @@ void clif_parse_AutoSpell(int fd,struct map_session_data *sd)
void clif_parse_UseCard(int fd,struct map_session_data *sd)
{
RFIFOHEAD(fd);
- if (sd->trade_partner != 0)
+ if (sd->state.trading!= 0)
return;
clif_use_card(sd,RFIFOW(fd,2)-2);
}
@@ -9798,7 +9798,7 @@ void clif_parse_UseCard(int fd,struct map_session_data *sd)
void clif_parse_InsertCard(int fd,struct map_session_data *sd)
{
RFIFOHEAD(fd);
- if (sd->trade_partner != 0)
+ if (sd->state.trading!= 0)
return;
pc_insert_card(sd,RFIFOW(fd,2)-2,RFIFOW(fd,4)-2);
}
diff --git a/src/map/npc.c b/src/map/npc.c
index 2d890f466..af2ed2c91 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -979,8 +979,8 @@ int npc_checknear(struct map_session_data *sd,int id)
return 1;
}
- //if (nd->class_<0) // イベント系は常にOK
- // return 0;
+ if (nd->class_<0) // イベント系は常にOK
+ return 0;
// エリア判定
if (nd->bl.m!=sd->bl.m ||