Act restriction on Lapine UI
This commit is contained in:
parent
22c466ba65
commit
80218e99e2
@ -936,7 +936,7 @@ ACMD_FUNC(storage)
|
|||||||
{
|
{
|
||||||
nullpo_retr(-1, sd);
|
nullpo_retr(-1, sd);
|
||||||
|
|
||||||
if (sd->npc_id || sd->state.vending || sd->state.buyingstore || sd->state.trading || sd->state.storage_flag ||sd->state.lapine_ui)
|
if (sd->npc_id || sd->state.vending || sd->state.buyingstore || sd->state.trading || sd->state.storage_flag || sd->state.lapine_ui)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (storage_storageopen(sd) == 1)
|
if (storage_storageopen(sd) == 1)
|
||||||
|
@ -11531,7 +11531,7 @@ void clif_parse_UseItem(int fd, struct map_session_data *sd)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (!sd->npc_id && pc_istrading(sd)) || sd->chatID || (sd->state.block_action & PCBLOCK_USEITEM) ) {
|
if ( (!sd->npc_id && pc_istrading(sd)) || sd->chatID || sd->state.lapine_ui || (sd->state.block_action & PCBLOCK_USEITEM) ) {
|
||||||
clif_msg(sd, WORK_IN_PROGRESS);
|
clif_msg(sd, WORK_IN_PROGRESS);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -20893,6 +20893,11 @@ void clif_parse_equipswitch_request_single( int fd, struct map_session_data* sd
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void clif_lapine_ui_reset(map_session_data *sd) {
|
||||||
|
sd->state.lapine_ui = 0;
|
||||||
|
sd->last_lapine_box = 0;
|
||||||
|
}
|
||||||
|
|
||||||
bool clif_synthesisui_open(struct map_session_data *sd, unsigned int itemid) {
|
bool clif_synthesisui_open(struct map_session_data *sd, unsigned int itemid) {
|
||||||
#if PACKETVER >= 20160525
|
#if PACKETVER >= 20160525
|
||||||
nullpo_retr(false, sd);
|
nullpo_retr(false, sd);
|
||||||
@ -20929,6 +20934,8 @@ void clif_synthesisui_result(struct map_session_data *sd, e_item_synthesis_resul
|
|||||||
unsigned short cmd = 0;
|
unsigned short cmd = 0;
|
||||||
s_packet_db *info = NULL;
|
s_packet_db *info = NULL;
|
||||||
|
|
||||||
|
clif_lapine_ui_reset(sd);
|
||||||
|
|
||||||
if (!(cmd = packet_db_ack[ZC_LAPINE_SYNTHESIS_RESULT]))
|
if (!(cmd = packet_db_ack[ZC_LAPINE_SYNTHESIS_RESULT]))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -20971,7 +20978,7 @@ void clif_parse_lapineSynthesis_submit(int fd, struct map_session_data* sd) {
|
|||||||
#endif
|
#endif
|
||||||
item_data *id;
|
item_data *id;
|
||||||
|
|
||||||
if (n < 1 || n > MAX_SYNTHESIS_SOURCES || sd->last_lapine_box != itemid || !(id = itemdb_exists(itemid))) {
|
if (n < 1 || n > MAX_SYNTHESIS_SOURCES || sd->last_lapine_box != itemid || sd->last_lapine_box != sd->itemid || !(id = itemdb_exists(itemid))) {
|
||||||
//clif_synthesisui_result(sd, SYNTHESIS_INVALID_ITEM);
|
//clif_synthesisui_result(sd, SYNTHESIS_INVALID_ITEM);
|
||||||
set_eof(sd->fd);
|
set_eof(sd->fd);
|
||||||
return;
|
return;
|
||||||
@ -21013,8 +21020,7 @@ void clif_parse_lapineSynthesis_submit(int fd, struct map_session_data* sd) {
|
|||||||
void clif_parse_lapineSynthesis_close(int fd, struct map_session_data* sd) {
|
void clif_parse_lapineSynthesis_close(int fd, struct map_session_data* sd) {
|
||||||
#if PACKETVER >= 20160525
|
#if PACKETVER >= 20160525
|
||||||
nullpo_retv(sd);
|
nullpo_retv(sd);
|
||||||
sd->state.lapine_ui = 0;
|
clif_lapine_ui_reset(sd);
|
||||||
sd->last_lapine_box = 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21054,6 +21060,8 @@ void clif_lapine_upgrade_result(struct map_session_data *sd, e_item_upgrade_resu
|
|||||||
unsigned short cmd = 0;
|
unsigned short cmd = 0;
|
||||||
s_packet_db *info = NULL;
|
s_packet_db *info = NULL;
|
||||||
|
|
||||||
|
clif_lapine_ui_reset(sd);
|
||||||
|
|
||||||
if (!(cmd = packet_db_ack[ZC_LAPINE_UPGRADE_RESULT]))
|
if (!(cmd = packet_db_ack[ZC_LAPINE_UPGRADE_RESULT]))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -21105,7 +21113,7 @@ void clif_parse_lapineUpgrade_submit(int fd, struct map_session_data* sd) {
|
|||||||
|
|
||||||
item_data *id;
|
item_data *id;
|
||||||
|
|
||||||
if (sd->last_lapine_box != itemid || index < 0 || index >= MAX_INVENTORY || !(id = itemdb_search(sd->last_lapine_box))) {
|
if (sd->last_lapine_box != itemid || sd->last_lapine_box != sd->itemid || index < 0 || index >= MAX_INVENTORY || !(id = itemdb_search(sd->last_lapine_box))) {
|
||||||
//clif_lapine_upgrade_result(sd, LAPINE_UPRAGDE_FAILURE);
|
//clif_lapine_upgrade_result(sd, LAPINE_UPRAGDE_FAILURE);
|
||||||
set_eof(sd->fd);
|
set_eof(sd->fd);
|
||||||
return;
|
return;
|
||||||
@ -21128,8 +21136,7 @@ void clif_parse_lapineUpgrade_submit(int fd, struct map_session_data* sd) {
|
|||||||
void clif_parse_lapineUpgrade_close(int fd, struct map_session_data* sd) {
|
void clif_parse_lapineUpgrade_close(int fd, struct map_session_data* sd) {
|
||||||
#if PACKETVER >= 20160525
|
#if PACKETVER >= 20160525
|
||||||
nullpo_retv(sd);
|
nullpo_retv(sd);
|
||||||
sd->state.lapine_ui = 0;
|
clif_lapine_ui_reset(sd);
|
||||||
sd->last_lapine_box = 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ uint64 ItemSynthesisDatabase::parseBodyNode(const YAML::Node &node) {
|
|||||||
bool item_synthesis_open(map_session_data *sd, unsigned int itemid) {
|
bool item_synthesis_open(map_session_data *sd, unsigned int itemid) {
|
||||||
nullpo_retr(false, sd);
|
nullpo_retr(false, sd);
|
||||||
|
|
||||||
if (sd->state.vending || sd->state.buyingstore || sd->state.trading || sd->state.storage_flag || sd->state.prevend || sd->state.lapine_ui)
|
if (pc_cant_act(sd))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (pc_is90overweight(sd) || !pc_inventoryblank(sd)) {
|
if (pc_is90overweight(sd) || !pc_inventoryblank(sd)) {
|
||||||
|
@ -107,7 +107,7 @@ uint64 ItemUpgradeDatabase::parseBodyNode(const YAML::Node &node) {
|
|||||||
bool item_upgrade_open(map_session_data *sd, unsigned int itemid) {
|
bool item_upgrade_open(map_session_data *sd, unsigned int itemid) {
|
||||||
nullpo_retr(false, sd);
|
nullpo_retr(false, sd);
|
||||||
|
|
||||||
if (sd->state.vending || sd->state.buyingstore || sd->state.trading || sd->state.storage_flag || sd->state.prevend || sd->state.lapine_ui)
|
if (pc_cant_act(sd))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (pc_is90overweight(sd) || !pc_inventoryblank(sd)) {
|
if (pc_is90overweight(sd) || !pc_inventoryblank(sd)) {
|
||||||
|
@ -902,7 +902,7 @@ extern struct s_job_info job_info[CLASS_COUNT];
|
|||||||
#define pc_cant_act(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chatID || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.lapine_ui )
|
#define pc_cant_act(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chatID || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.lapine_ui )
|
||||||
|
|
||||||
/* equals pc_cant_act except it doesn't check for chat rooms or npcs */
|
/* equals pc_cant_act except it doesn't check for chat rooms or npcs */
|
||||||
#define pc_cant_act2(sd) ( (sd)->state.vending || (sd)->state.buyingstore || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend )
|
#define pc_cant_act2(sd) ( (sd)->state.vending || (sd)->state.buyingstore || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.lapine_ui )
|
||||||
|
|
||||||
#define pc_setdir(sd,b,h) ( (sd)->ud.dir = (b) ,(sd)->head_dir = (h) )
|
#define pc_setdir(sd,b,h) ( (sd)->ud.dir = (b) ,(sd)->head_dir = (h) )
|
||||||
#define pc_setchatid(sd,n) ( (sd)->chatID = n )
|
#define pc_setchatid(sd,n) ( (sd)->chatID = n )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user