|
@@ -19924,9 +19924,15 @@ void clif_parse_sale_refresh( int fd, struct map_session_data* sd ){
|
|
/// 09b5 (ZC_OPEN_BARGAIN_SALE_TOOL)
|
|
/// 09b5 (ZC_OPEN_BARGAIN_SALE_TOOL)
|
|
void clif_sale_open( struct map_session_data* sd ){
|
|
void clif_sale_open( struct map_session_data* sd ){
|
|
#if PACKETVER_SUPPORTS_SALES
|
|
#if PACKETVER_SUPPORTS_SALES
|
|
- int fd = sd->fd;
|
|
|
|
|
|
+ nullpo_retv(sd);
|
|
|
|
+
|
|
|
|
+ if( sd->state.sale_open ){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
- // TODO: do we want state tracking?
|
|
|
|
|
|
+ sd->state.sale_open = true;
|
|
|
|
+
|
|
|
|
+ int fd = sd->fd;
|
|
|
|
|
|
WFIFOHEAD(fd, 2);
|
|
WFIFOHEAD(fd, 2);
|
|
WFIFOW(fd, 0) = 0x9b5;
|
|
WFIFOW(fd, 0) = 0x9b5;
|
|
@@ -19945,11 +19951,11 @@ void clif_parse_sale_open( int fd, struct map_session_data* sd ){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- if( !pc_has_permission( sd, PC_PERM_CASHSHOP_SALE ) ){
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ char command[CHAT_SIZE_MAX];
|
|
|
|
|
|
- clif_sale_open(sd);
|
|
|
|
|
|
+ safesnprintf( command, sizeof(command), "%climitedsale", atcommand_symbol );
|
|
|
|
+
|
|
|
|
+ is_atcommand(fd, sd, command, 1);
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
|
|
|
|
@@ -19957,6 +19963,14 @@ void clif_parse_sale_open( int fd, struct map_session_data* sd ){
|
|
/// 09bd (ZC_CLOSE_BARGAIN_SALE_TOOL)
|
|
/// 09bd (ZC_CLOSE_BARGAIN_SALE_TOOL)
|
|
void clif_sale_close(struct map_session_data* sd) {
|
|
void clif_sale_close(struct map_session_data* sd) {
|
|
#if PACKETVER_SUPPORTS_SALES
|
|
#if PACKETVER_SUPPORTS_SALES
|
|
|
|
+ nullpo_retv(sd);
|
|
|
|
+
|
|
|
|
+ if( !sd->state.sale_open ){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ sd->state.sale_open = false;
|
|
|
|
+
|
|
int fd = sd->fd;
|
|
int fd = sd->fd;
|
|
|
|
|
|
WFIFOHEAD(fd, 2);
|
|
WFIFOHEAD(fd, 2);
|
|
@@ -19975,8 +19989,6 @@ void clif_parse_sale_close(int fd, struct map_session_data* sd) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- // TODO: do we want state tracking?
|
|
|
|
-
|
|
|
|
clif_sale_close(sd);
|
|
clif_sale_close(sd);
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
@@ -20015,7 +20027,7 @@ void clif_parse_sale_search( int fd, struct map_session_data* sd ){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- if( !pc_has_permission( sd, PC_PERM_CASHSHOP_SALE ) ){
|
|
|
|
|
|
+ if( !sd->state.sale_open ){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -20069,7 +20081,7 @@ void clif_parse_sale_add( int fd, struct map_session_data* sd ){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- if( !pc_has_permission( sd, PC_PERM_CASHSHOP_SALE ) ){
|
|
|
|
|
|
+ if( !sd->state.sale_open ){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -20112,7 +20124,7 @@ void clif_parse_sale_remove( int fd, struct map_session_data* sd ){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- if( !pc_has_permission( sd, PC_PERM_CASHSHOP_SALE ) ){
|
|
|
|
|
|
+ if( !sd->state.sale_open ){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|