summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-04 02:29:06 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-04 02:29:06 +0000
commit683dbd2fad6c911b279e87f03ec8a6d0a17a435d (patch)
tree557f00ec9fe0b487dd29f5d51f50de880c66121d /src
parent9948c02946e55229d5c9951ab9aaec3184611734 (diff)
downloadhercules-683dbd2fad6c911b279e87f03ec8a6d0a17a435d.tar.gz
hercules-683dbd2fad6c911b279e87f03ec8a6d0a17a435d.tar.bz2
hercules-683dbd2fad6c911b279e87f03ec8a6d0a17a435d.tar.xz
hercules-683dbd2fad6c911b279e87f03ec8a6d0a17a435d.zip
Pets & Homun renaming with empty name fix, bugreport:3032
Also: - Fixed client crash when sending weapon + dragon/mado/newmount - Fixed 2011-11-16 charinfo_size bug on char selection screen git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15377 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/char_sql/char.c23
-rw-r--r--src/map/homunculus.c5
-rw-r--r--src/map/pet.c5
3 files changed, 23 insertions, 10 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 78cd67d79..99a6cc669 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -937,6 +937,7 @@ int mmo_chars_fromsql(struct char_session_data* sd, uint8* buf)
{
if( p.delete_date && p.delete_date < time(NULL) ) {
delete_char_sql(p.char_id);
+ i--;
continue;
}
p.last_point.map = mapindex_name2id(last_map);
@@ -1644,7 +1645,10 @@ int mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p)
WBUFW(buf,50) = DEFAULT_WALK_SPEED; // p->speed;
WBUFW(buf,52) = p->class_;
WBUFW(buf,54) = p->hair;
- WBUFW(buf,56) = p->option&0x20 ? 0 : p->weapon; //When the weapon is sent and your option is riding, the client crashes on login!?
+
+ //When the weapon is sent and your option is riding, the client crashes on login!?
+ WBUFW(buf,56) = p->option&(0x20|0x80000|0x100000|0x200000|0x400000|0x800000|0x1000000|0x2000000|0x4000000|0x8000000) ? 0 : p->weapon;
+
WBUFW(buf,58) = p->base_level;
WBUFW(buf,60) = min(p->skill_point, INT16_MAX);
WBUFW(buf,62) = p->head_bottom;
@@ -1677,14 +1681,17 @@ int mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p)
WBUFL(buf,128) = p->robe;
offset += 4;
#endif
-#if PACKETVER >= 20110928
- WBUFL(buf,132) = 0; // change slot feature (0 = disabled, otherwise enabled)
- offset += 4;
-#endif
-#if PACKETVER >= 20111025
- WBUFL(buf,136) = 0; // unknown purpose (0 = disabled, otherwise displays "Add-Ons" sidebar)
- offset += 4;
+#if PACKETVER != 20111116 //2011-11-16 wants 136, ask gravity.
+ #if PACKETVER >= 20110928
+ WBUFL(buf,132) = 0; // change slot feature (0 = disabled, otherwise enabled)
+ offset += 4;
+ #endif
+ #if PACKETVER >= 20111025
+ WBUFL(buf,136) = 0; // unknown purpose (0 = disabled, otherwise displays "Add-Ons" sidebar)
+ offset += 4;
+ #endif
#endif
+
return 106+offset;
}
diff --git a/src/map/homunculus.c b/src/map/homunculus.c
index 50b7c2c7a..f5d3dbcd5 100644
--- a/src/map/homunculus.c
+++ b/src/map/homunculus.c
@@ -555,7 +555,10 @@ int merc_hom_change_name_ack(struct map_session_data *sd, char* name, int flag)
{
struct homun_data *hd = sd->hd;
if (!merc_is_hom_active(hd)) return 0;
- if (!flag) {
+
+ normalize_name(name," ");//bugreport:3032
+
+ if ( !flag || !strlen(name) ) {
clif_displaymessage(sd->fd, msg_txt(280)); // You cannot use this name
return 0;
}
diff --git a/src/map/pet.c b/src/map/pet.c
index ef4750310..fb5ba4699 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -630,7 +630,10 @@ int pet_change_name_ack(struct map_session_data *sd, char* name, int flag)
{
struct pet_data *pd = sd->pd;
if (!pd) return 0;
- if (!flag) {
+
+ normalize_name(name," ");//bugreport:3032
+
+ if ( !flag || !strlen(name) ) {
clif_displaymessage(sd->fd, msg_txt(280)); // You cannot use this name for your pet.
clif_send_petstatus(sd); //Send status so client knows oet name change got rejected.
return 0;