summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-04 13:59:42 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-04 13:59:42 +0000
commit5edc20529759c12add3da5c3ed0a1cfe335de6b8 (patch)
treeb56a90c9e21301b4117e53cda82c9362aeaab761 /src
parent12966eebf5750b2dc0a4394204aaf6d2b1d554db (diff)
downloadhercules-5edc20529759c12add3da5c3ed0a1cfe335de6b8.tar.gz
hercules-5edc20529759c12add3da5c3ed0a1cfe335de6b8.tar.bz2
hercules-5edc20529759c12add3da5c3ed0a1cfe335de6b8.tar.xz
hercules-5edc20529759c12add3da5c3ed0a1cfe335de6b8.zip
- Fixed the txt->sql converter not escaping character names before saving them.
- Fixed a pet's level not resetting to their db level when you enable pet leveling and later on decide to turn it off. - Fixed a bad initialization in pc_setnewpc - Fixed restricted equipment not updating your view info after they are unequipped. - Removed a bunch of extra text/checks when ignoring characters (/ex) when Aegis does none of these checks. /inall now wipes your ignore list (it does this on Aegis, too). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9400 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/char_sql/char.c7
-rw-r--r--src/map/clif.c34
-rw-r--r--src/map/pc.c6
-rw-r--r--src/map/status.c5
4 files changed, 21 insertions, 31 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 36fb788de..136453e3b 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -492,15 +492,18 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus *p){
if (!memitemdata_to_sql(mapitem, count, p->char_id,TABLE_CART))
strcat(save_status, " cart");
#ifdef TXT_SQL_CONVERT
- //Insert the barebones to then update the rest.
+{ //Insert the barebones to then update the rest.
+ char t_name[NAME_LENGTH*2];
+ jstrescapecpy(t_name, p->name);
sprintf(tmp_sql, "REPLACE INTO `%s` (`account_id`, `char_num`, `name`) VALUES ('%d', '%d', '%s')",
- char_db, p->account_id, p->char_num, p->name);
+ char_db, p->account_id, p->char_num, t_name);
if(mysql_query(&mysql_handle, tmp_sql))
{
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
} else
strcat(save_status, " creation");
+}
#endif
if (
diff --git a/src/map/clif.c b/src/map/clif.c
index 69b7d1af8..31fdd80f7 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -11098,16 +11098,6 @@ void clif_parse_PMIgnore(int fd, struct map_session_data *sd) { // Rewritten by
WFIFOW(fd,0) = 0x0d1; // R 00d1 <type>.B <fail>.B: type: 0: deny, 1: allow, fail: 0: success, 1: fail
WFIFOB(fd,2) = RFIFOB(fd,26);
- // do nothing only if nick can not exist
- if (strlen(nick) < 4) {
- WFIFOB(fd,3) = 1; // fail
- WFIFOSET(fd, packet_len_table[0x0d1]);
- clif_wis_message(fd, wisp_server_name,
- "This player name is not valid.",
- strlen("This player name is not valid.")+1);
- return;
- }
- // name can exist
// deny action (we add nick only if it's not already exist
if (RFIFOB(fd,26) == 0) { // Add block
for(i = 0; i < MAX_IGNORE_LIST &&
@@ -11118,9 +11108,6 @@ void clif_parse_PMIgnore(int fd, struct map_session_data *sd) { // Rewritten by
if (i == MAX_IGNORE_LIST) { //Full List
WFIFOB(fd,3) = 1; // fail
WFIFOSET(fd, packet_len_table[0x0d1]);
- clif_wis_message(fd, wisp_server_name,
- "You can not block more people.",
- strlen("You can not block more people.") + 1);
if (strcmp(wisp_server_name, nick) == 0)
{ // to found possible bot users who automaticaly ignore people.
sprintf(output, "Character '%s' (account: %d) has tried to block wisps from '%s' (wisp name of the server). Bot user?", sd->status.name, sd->status.account_id, wisp_server_name);
@@ -11130,11 +11117,8 @@ void clif_parse_PMIgnore(int fd, struct map_session_data *sd) { // Rewritten by
}
if(sd->ignore[i].name[0] != '\0')
{ //Name already exists.
- WFIFOB(fd,3) = 1; // fail
+ WFIFOB(fd,3) = 0; // Aegis reports success.
WFIFOSET(fd, packet_len_table[0x0d1]);
- clif_wis_message(fd, wisp_server_name,
- "This player is already blocked.",
- strlen("This player is already blocked.") + 1);
if (strcmp(wisp_server_name, nick) == 0) { // to found possible bot users who automaticaly ignore people.
sprintf(output, "Character '%s' (account: %d) has tried AGAIN to block wisps from '%s' (wisp name of the server). Bot user?", sd->status.name, sd->status.account_id, wisp_server_name);
intif_wis_message_to_gm(wisp_server_name, battle_config.hack_info_GM_level, output);
@@ -11168,9 +11152,6 @@ void clif_parse_PMIgnore(int fd, struct map_session_data *sd) { // Rewritten by
{ //Not found
WFIFOB(fd,3) = 1; // fail
WFIFOSET(fd, packet_len_table[0x0d1]);
- clif_wis_message(fd, wisp_server_name,
- "This player is not blocked by you.",
- strlen("This player is not blocked by you.") + 1);
return;
}
//Move everything one place down to overwrite removed entry.
@@ -11199,9 +11180,6 @@ void clif_parse_PMIgnoreAll(int fd, struct map_session_data *sd) { // Rewritten
if (sd->state.ignoreAll) {
WFIFOB(fd,3) = 1; // fail
WFIFOSET(fd, packet_len_table[0x0d2]);
- clif_wis_message(fd, wisp_server_name,
- "You already block everyone.",
- strlen("You already block everyone.") + 1);
return;
}
sd->state.ignoreAll = 1;
@@ -11211,11 +11189,15 @@ void clif_parse_PMIgnoreAll(int fd, struct map_session_data *sd) { // Rewritten
}
//Unblock everyone
if (!sd->state.ignoreAll) {
+ if (sd->ignore[0].name[0] != '\0')
+ { //Wipe the ignore list.
+ memset(sd->ignore, 0, sizeof(sd->ignore));
+ WFIFOB(fd,3) = 0;
+ WFIFOSET(fd, packet_len_table[0x0d2]);
+ return;
+ }
WFIFOB(fd,3) = 1; // fail
WFIFOSET(fd, packet_len_table[0x0d2]);
- clif_wis_message(fd, wisp_server_name,
- "You already allow everyone.",
- strlen("You already allow everyone.") + 1);
return;
}
sd->state.ignoreAll = 0;
diff --git a/src/map/pc.c b/src/map/pc.c
index 86b8d5cdb..6630a38c5 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -358,7 +358,7 @@ int pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int lo
nullpo_retr(0, sd);
sd->bl.id = account_id;
- sd->status.char_id = account_id;
+ sd->status.account_id = account_id;
sd->status.char_id = char_id;
sd->status.sex = sex;
sd->login_id1 = login_id1;
@@ -6599,8 +6599,10 @@ int pc_checkitem(struct map_session_data *sd)
pc_setequipindex(sd);
if(calc_flag && sd->state.auth)
+ {
status_calc_pc(sd,0);
-
+ pc_equiplookall(sd);
+ }
return 0;
}
diff --git a/src/map/status.c b/src/map/status.c
index 1af25239a..1cd81a180 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1474,8 +1474,11 @@ int status_calc_pet(struct pet_data *pd, int first)
if (!first) //Not done the first time because the pet is not visible yet
clif_send_petstatus(sd);
}
- } else if (first)
+ } else if (first) {
status_calc_misc(&pd->bl, &pd->status, pd->db->lv);
+ if (!battle_config.pet_lv_rate && pd->pet.level != pd->db->lv)
+ pd->pet.level = pd->db->lv;
+ }
//Support rate modifier (1000 = 100%)
pd->rate_fix = 1000*(pd->pet.intimate - battle_config.pet_support_min_friendly)/(1000- battle_config.pet_support_min_friendly) +500;