summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-09-09 20:24:24 -0300
committershennetsind <ind@henn.et>2013-09-09 20:24:24 -0300
commit58e2d279f26e9f9034ca80646a82addaafeb7ef2 (patch)
treeae47727d1192f7c865d3e2b096fb52b2aadc68d5
parentdf1952d3ecaa5708dbe12e6f32137243c6bfdacb (diff)
downloadhercules-58e2d279f26e9f9034ca80646a82addaafeb7ef2.tar.gz
hercules-58e2d279f26e9f9034ca80646a82addaafeb7ef2.tar.bz2
hercules-58e2d279f26e9f9034ca80646a82addaafeb7ef2.tar.xz
hercules-58e2d279f26e9f9034ca80646a82addaafeb7ef2.zip
Fixed Bug #7540
Fixed searchstores crashing when trying to query data of offline vendings (vending db wasn't removing entries upon logout), also changed vending->db index to char id instead of vender id. Special Thanks to hemagx, jTynne. http://hercules.ws/board/tracker/issue-7540-new-map-crash/ Signed-off-by: shennetsind <ind@henn.et>
-rw-r--r--src/map/map.c4
-rw-r--r--src/map/vending.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/map/map.c b/src/map/map.c
index d3d7ac65d..cbef8ca95 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1622,6 +1622,10 @@ int map_quit(struct map_session_data *sd) {
}
}
+ if( sd->state.vending ) {
+ idb_remove(vending->db, sd->status.char_id);
+ }
+
party->booking_delete(sd); // Party Booking [Spiria]
pc->makesavestatus(sd);
pc->clean_skilltree(sd);
diff --git a/src/map/vending.c b/src/map/vending.c
index 2784d46a2..32e084a87 100644
--- a/src/map/vending.c
+++ b/src/map/vending.c
@@ -283,7 +283,7 @@ void vending_openvending(struct map_session_data* sd, const char* message, const
clif->openvending(sd,sd->bl.id,sd->vending);
clif->showvendingboard(&sd->bl,message,0);
- idb_put(vending->db, sd->vender_id, sd);
+ idb_put(vending->db, sd->status.char_id, sd);
}