summaryrefslogtreecommitdiff
path: root/src/map/guild.c
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-21 02:32:51 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-21 02:32:51 +0000
commitb5267523b67fbb77deacd7e9b44110a31086805d (patch)
tree8d22dc2c79a8239524efab8a484f0584ee26ca91 /src/map/guild.c
parentd3a2bbe60ca0a543713bc0bdd280be7c9c9c2951 (diff)
downloadhercules-b5267523b67fbb77deacd7e9b44110a31086805d.tar.gz
hercules-b5267523b67fbb77deacd7e9b44110a31086805d.tar.bz2
hercules-b5267523b67fbb77deacd7e9b44110a31086805d.tar.xz
hercules-b5267523b67fbb77deacd7e9b44110a31086805d.zip
- Added a 1-node cache to db. Removed party_cache and guild_cache since now the database has a cache.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9545 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/guild.c')
-rw-r--r--src/map/guild.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/map/guild.c b/src/map/guild.c
index 0ddb966d5..a5db3664a 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -25,12 +25,11 @@
#include "skill.h"
#include "log.h"
-static struct guild* guild_cache; //For fast retrieval of the same guild over and over. [Skotlex]
-static struct dbt *guild_db;
-static struct dbt *castle_db;
-static struct dbt *guild_expcache_db;
-static struct dbt *guild_infoevent_db;
-static struct dbt *guild_castleinfoevent_db;
+static DB guild_db;
+static DB castle_db;
+static DB guild_expcache_db;
+static DB guild_infoevent_db;
+static DB guild_castleinfoevent_db;
struct eventlist {
char name[50];
@@ -225,10 +224,7 @@ void do_init_guild(void)
// ŒŸõ
struct guild *guild_search(int guild_id)
{
- if(guild_cache && guild_cache->guild_id == guild_id)
- return guild_cache;
- guild_cache = idb_get(guild_db,guild_id);
- return guild_cache;
+ return idb_get(guild_db,guild_id);
}
int guild_searchname_sub(DBKey key,void *data,va_list ap)
{
@@ -1576,8 +1572,6 @@ int guild_broken(int guild_id,int flag)
guild_db->foreach(guild_db,guild_broken_sub,guild_id);
castle_db->foreach(castle_db,castle_guild_broken_sub,guild_id);
- if (guild_cache && guild_cache->guild_id == guild_id)
- guild_cache = NULL;
guild_storage_delete(guild_id);
idb_remove(guild_db,guild_id);
return 0;