summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-06-02 02:16:55 +0200
committerHaru <haru@dotalux.com>2015-06-02 02:22:51 +0200
commitd66cc50af6d781d179f46ae67d74bf26bf5914e5 (patch)
treeec129bc522ea712eddecc80f9e5697b9bba7d88e /src/map/pc.c
parentad958235cfc56b86da89bdc2aa1e5155b0c006a1 (diff)
downloadhercules-d66cc50af6d781d179f46ae67d74bf26bf5914e5.tar.gz
hercules-d66cc50af6d781d179f46ae67d74bf26bf5914e5.tar.bz2
hercules-d66cc50af6d781d179f46ae67d74bf26bf5914e5.tar.xz
hercules-d66cc50af6d781d179f46ae67d74bf26bf5914e5.zip
Re-implemented clif->colormes to accept arbitrary colors
- Due to the backward-incompatible change, clif->colormes was renamed to clif->messagecolor_self (for similarity with clif->messagecolor). The 'color' argument is now a 0xRRGGBB color rather than a color_table index. - enum clif_colors is no longer needed, but 0xRRGGBB-based constants are now provided to replace the old COLOR_* values. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index b2dd11581..d105edfda 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4325,12 +4325,12 @@ int pc_isUseitem(struct map_session_data *sd,int n)
if ((item->item_usage.flag&INR_SITTING) && (pc_issit(sd) == 1) && (pc_get_group_level(sd) < item->item_usage.override)) {
clif->msgtable(sd, MSG_ITEM_NEED_STANDING);
- //clif->colormes(sd->fd,COLOR_WHITE,msg_txt(1474));
+ //clif->messagecolor_self(sd->fd, COLOR_WHITE, msg_txt(1474));
return 0; // You cannot use this item while sitting.
}
if (sd->state.storage_flag != STORAGE_FLAG_CLOSED && item->type != IT_CASH) {
- clif->colormes(sd->fd, COLOR_RED, msg_sd(sd,1475));
+ clif->messagecolor_self(sd->fd, COLOR_RED, msg_sd(sd,1475));
return 0; // You cannot use this item while storage is open.
}
@@ -4433,8 +4433,8 @@ int pc_isUseitem(struct map_session_data *sd,int n)
clif->msgtable(sd, MSG_ITEM_CANT_OBTAIN_WEIGHT);
return 0;
}
- if( !pc->inventoryblank(sd) ) {
- clif->colormes(sd->fd,COLOR_RED,msg_sd(sd,1477));
+ if (!pc->inventoryblank(sd)) {
+ clif->messagecolor_self(sd->fd, COLOR_RED, msg_sd(sd,1477));
return 0;
}
}
@@ -6642,14 +6642,12 @@ int pc_skillup(struct map_session_data *sd,uint16 skill_id) {
if (!pc_has_permission(sd, PC_PERM_ALL_SKILL)) // may skill everything at any time anyways, and this would cause a huge slowdown
clif->skillinfoblock(sd);
} else if( battle_config.skillup_limit ){
- if( sd->sktree.second )
+ if (sd->sktree.second)
clif->msgtable_num(sd, MSG_SKILL_POINTS_LEFT_JOB1, sd->sktree.second);
- else if( sd->sktree.third )
+ else if (sd->sktree.third)
clif->msgtable_num(sd, MSG_SKILL_POINTS_LEFT_JOB2, sd->sktree.third);
- else if( pc->calc_skillpoint(sd) < 9 ) {
- /* TODO: official response? */
- clif->colormes(sd->fd,COLOR_RED,"You need the basic skills");
- }
+ else if (pc->calc_skillpoint(sd) < 9) /* TODO: official response? */
+ clif->messagecolor_self(sd->fd, COLOR_RED, "You need the basic skills");
}
return 0;
}
@@ -10651,15 +10649,15 @@ void pc_bank_deposit(struct map_session_data *sd, int money) {
void pc_bank_withdraw(struct map_session_data *sd, int money) {
unsigned int limit_check = money+sd->status.zeny;
- if( money <= 0 ) {
+ if (money <= 0) {
clif->bank_withdraw(sd,BWA_UNKNOWN_ERROR);
return;
- } else if ( money > sd->status.bank_vault ) {
+ } else if (money > sd->status.bank_vault) {
clif->bank_withdraw(sd,BWA_NO_MONEY);
return;
- } else if ( limit_check > MAX_ZENY ) {
+ } else if (limit_check > MAX_ZENY) {
/* no official response for this scenario exists. */
- clif->colormes(sd->fd,COLOR_RED,msg_sd(sd,1482));
+ clif->messagecolor_self(sd->fd, COLOR_RED, msg_sd(sd,1482));
return;
}