summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c4
-rw-r--r--src/map/packets_struct.h12
-rw-r--r--src/map/skill.c2
3 files changed, 16 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 9e6e0f779..2cb3bebaa 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -11971,6 +11971,8 @@ static void clif_parse_RepairItem(int fd, struct map_session_data *sd) __attribu
/// 01fd <index>.W <name id>.W <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W
static void clif_parse_RepairItem(int fd, struct map_session_data *sd)
{
+ const struct PACKET_CZ_REQ_ITEMREPAIR *p = RFIFOP(fd, 0);
+
if (sd->menuskill_id != BS_REPAIRWEAPON)
return;
if (pc_istrading(sd)) {
@@ -11979,7 +11981,7 @@ static void clif_parse_RepairItem(int fd, struct map_session_data *sd)
clif_menuskill_clear(sd);
return;
}
- skill->repairweapon(sd,RFIFOW(fd,2));
+ skill->repairweapon(sd, p->index);
clif_menuskill_clear(sd);
}
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index f9b5a913f..1cf2830f0 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -2148,6 +2148,18 @@ struct PACKET_ZC_FAILED_TRADE_BUYING_STORE_TO_SELLER {
#endif
} __attribute__((packed));
+struct PACKET_CZ_REQ_ITEMREPAIR {
+ int16 packetType;
+ int16 index;
+#if PACKETVER_RE_NUM >= 20180704
+ uint32 itemId;
+#else
+ uint16 itemId;
+#endif
+ uint8 refine;
+ struct EQUIPSLOTINFO slot;
+} __attribute__((packed));
+
#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
#pragma pack(pop)
#endif // not NetBSD < 6 / Solaris
diff --git a/src/map/skill.c b/src/map/skill.c
index b00274810..64b04e7b4 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -16097,7 +16097,7 @@ static void skill_repairweapon(struct map_session_data *sd, int idx)
if ( !( target_sd = map->id2sd(sd->menuskill_val) ) ) //Failed....
return;
- if( idx == 0xFFFF ) // No item selected ('Cancel' clicked)
+ if (idx == 0xFFFF || idx == -1) // No item selected ('Cancel' clicked)
return;
if( idx < 0 || idx >= MAX_INVENTORY )
return; //Invalid index??