summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-02-19 14:45:58 -0300
committershennetsind <ind@henn.et>2014-02-19 14:45:58 -0300
commit01e3ab933f54432a07247f3babede749b6455129 (patch)
treee7e926637dbdc844909b4ae2cc0b851615cf36a0 /src/map
parenta180d7f8f651fa7a79efdd275cd707559025c388 (diff)
downloadhercules-01e3ab933f54432a07247f3babede749b6455129.tar.gz
hercules-01e3ab933f54432a07247f3babede749b6455129.tar.bz2
hercules-01e3ab933f54432a07247f3babede749b6455129.tar.xz
hercules-01e3ab933f54432a07247f3babede749b6455129.zip
Fixed Bug 8031
way to check for char server connection fixed Special Thanks to FeNixZ! http://hercules.ws/board/tracker/issue-8031-map-server-crash-save-scdata-single-del-scdata-single/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/chrif.c5
-rw-r--r--src/map/intif.c2
2 files changed, 3 insertions, 4 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 9f968d35b..d6f0e5ef8 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -457,7 +457,6 @@ int chrif_reconnect(DBKey key, DBData *data, va_list ap) {
chrif->changemapserver(sd, ip, port);
else //too much lag/timeout is the closest explanation for this error.
clif->authfail_fd(sd->fd, 3);
-
break;
}
}
@@ -1565,7 +1564,7 @@ void chrif_send_report(char* buf, int len) {
**/
void chrif_save_scdata_single(int account_id, int char_id, short type, struct status_change_entry *sce) {
- if( !chrif->fd )
+ if( !chrif->isconnected() )
return;
WFIFOHEAD(chrif->fd, 28);
@@ -1587,7 +1586,7 @@ void chrif_save_scdata_single(int account_id, int char_id, short type, struct st
**/
void chrif_del_scdata_single(int account_id, int char_id, short type) {
- if( !chrif->fd ) {
+ if( !chrif->isconnected() ) {
ShowError("MAYDAY! failed to delete status %d from CID:%d/AID:%d\n",type,char_id,account_id);
return;
}
diff --git a/src/map/intif.c b/src/map/intif.c
index 49fbe4721..f04ec4015 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -273,7 +273,7 @@ int intif_saveregistry(struct map_session_data *sd) {
int plen = 0;
size_t len;
- if (intif->CheckForCharServer())
+ if (intif->CheckForCharServer() || !sd->var_db)
return -1;
WFIFOHEAD(inter_fd, 60000 + 300);