diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-05-18 17:37:33 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-05-18 18:49:39 -0700 |
commit | ac359e696f162090840dab488a6ef4981d35bbda (patch) | |
tree | 2ee04de23428bba264d1e39c80d5f50180d1b555 /src/char/inter.cpp | |
parent | fd00d50574064db9edfcccc4286ed8f1b55b185a (diff) | |
download | tmwa-ac359e696f162090840dab488a6ef4981d35bbda.tar.gz tmwa-ac359e696f162090840dab488a6ef4981d35bbda.tar.bz2 tmwa-ac359e696f162090840dab488a6ef4981d35bbda.tar.xz tmwa-ac359e696f162090840dab488a6ef4981d35bbda.zip |
Tweak a little memory management in char-server
Diffstat (limited to 'src/char/inter.cpp')
-rw-r--r-- | src/char/inter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/char/inter.cpp b/src/char/inter.cpp index 9efb28c..59a2945 100644 --- a/src/char/inter.cpp +++ b/src/char/inter.cpp @@ -381,7 +381,6 @@ static int mapif_parse_WisRequest(int fd) { static int wisid = 0; - int index; if (RFIFOW(fd, 2) - 52 <= 0) { // normaly, impossible, but who knows... @@ -390,7 +389,8 @@ int mapif_parse_WisRequest(int fd) } // search if character exists before to ask all map-servers - if ((index = search_character_index((const char *)RFIFOP(fd, 28))) == -1) + const mmo_charstatus *mcs = search_character(static_cast<const char *>(RFIFOP(fd, 28))); + if (!mcs) { unsigned char buf[27]; WBUFW(buf, 0) = 0x3802; @@ -402,7 +402,7 @@ int mapif_parse_WisRequest(int fd) else { // to be sure of the correct name, rewrite it - strzcpy(static_cast<char *>(const_cast<void *>(RFIFOP(fd, 28))), search_character_name(index), 24); + strzcpy(static_cast<char *>(const_cast<void *>(RFIFOP(fd, 28))), mcs->name, 24); // if source is destination, don't ask other servers. if (strcmp((const char *)RFIFOP(fd, 4), (const char *)RFIFOP(fd, 28)) == 0) { |