From 544a75b873a3dbdfa21435a3ab93fea453406a5b Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Mon, 1 Jun 2015 19:20:13 +0200 Subject: Follow up to Mishima's cleanup in ad958235cf --- src/map/atcommand.c | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 47e874492..79e0317d6 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -8785,14 +8785,7 @@ ACMD(channel) { unsigned short msg_len = 1; msg_len += sprintf(mout, "[ %s list colors ] : %s", command, channel->config->colors_name[k]); - // FIXME: This is clif code. - WFIFOHEAD(fd,msg_len + 12); - WFIFOW(fd,0) = 0x2C1; - WFIFOW(fd,2) = msg_len + 12; - WFIFOL(fd,4) = 0; - WFIFOL(fd,8) = channel->config->colors[k]; - safestrncpy((char*)WFIFOP(fd,12), mout, msg_len); - WFIFOSET(fd, msg_len + 12); + clif->colormes( fd, (enum clif_colors)channel->config->colors[k], mout ); } } else { DBIterator *iter = db_iterator(channel->db); @@ -9177,14 +9170,8 @@ ACMD(fontcolor) { if( !message || !*message ) { for( k = 0; k < channel->config->colors_count; k++ ) { msg_len += sprintf(mout, "[ %s ] : %s", command, channel->config->colors_name[k]); - // FIXME: This is clif code. - WFIFOHEAD(fd,msg_len + 12); - WFIFOW(fd,0) = 0x2C1; - WFIFOW(fd,2) = msg_len + 12; - WFIFOL(fd,4) = 0; - WFIFOL(fd,8) = channel->config->colors[k]; - safestrncpy((char*)WFIFOP(fd,12), mout, msg_len); - WFIFOSET(fd, msg_len + 12); + + clif->colormes( fd, (enum clif_colors)channel->config->colors[k], mout ); } return false; } @@ -9207,14 +9194,8 @@ ACMD(fontcolor) { sd->fontcolor = k + 1; msg_len += sprintf(mout, "Color changed to '%s'", channel->config->colors_name[k]); - // FIXME: This is clif code. - WFIFOHEAD(fd,msg_len + 12); - WFIFOW(fd,0) = 0x2C1; - WFIFOW(fd,2) = msg_len + 12; - WFIFOL(fd,4) = 0; - WFIFOL(fd,8) = channel->config->colors[k]; - safestrncpy((char*)WFIFOP(fd,12), mout, msg_len); - WFIFOSET(fd, msg_len + 12); + clif->colormes( fd, (enum clif_colors)channel->config->colors[k], mout ); + return true; } ACMD(searchstore){ -- cgit v1.2.3-60-g2f50 From 3b4362cd0148a0cabf37306eccf1abbff0edc360 Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Mon, 1 Jun 2015 19:21:00 +0200 Subject: Followup in malufett's commit a5a8605 --- src/map/pc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/map/pc.c b/src/map/pc.c index b2dd11581..06a343714 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -181,8 +181,12 @@ int pc_spiritball_timer(int tid, int64 tick, int id, intptr_t data) { * @retval total number of spiritball **/ int pc_getmaxspiritball(struct map_session_data *sd, int min) { + int result; + nullpo_ret(sd); - int result = pc->checkskill(sd, MO_CALLSPIRITS); + + result = pc->checkskill(sd, MO_CALLSPIRITS); + if ( min && result < min ) result = min; else if ( sd->sc.data[SC_RAISINGDRAGON] ) -- cgit v1.2.3-60-g2f50