summaryrefslogtreecommitdiff
path: root/src/map/instance.c
diff options
context:
space:
mode:
authorepoque11 <epoque11@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-04-28 22:15:18 +0000
committerepoque11 <epoque11@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-04-28 22:15:18 +0000
commitb6a5ac44371ff714d18a04f3acbe29955ace07aa (patch)
treeea97e1dc9254a40f2b6eb0bdac6418c024fda20d /src/map/instance.c
parent4f2de079cdabfa86b609a5ad15df3a4c1c58437b (diff)
downloadhercules-b6a5ac44371ff714d18a04f3acbe29955ace07aa.tar.gz
hercules-b6a5ac44371ff714d18a04f3acbe29955ace07aa.tar.bz2
hercules-b6a5ac44371ff714d18a04f3acbe29955ace07aa.tar.xz
hercules-b6a5ac44371ff714d18a04f3acbe29955ace07aa.zip
- Fixed an issue with the instance variable storage system never being initialised (since unknown revision)
- Combined both string and integer instance variables into a single DBMap* structure - Fixed a missing new-line at the end of src/common/conf.h causing warnings git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15998 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/instance.c')
-rw-r--r--src/map/instance.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/map/instance.c b/src/map/instance.c
index b105a09fa..fcbc03e5e 100644
--- a/src/map/instance.c
+++ b/src/map/instance.c
@@ -82,8 +82,7 @@ int instance_create(int party_id, const char *name)
instance[i].progress_timeout = 0;
instance[i].users = 0;
instance[i].party_id = party_id;
- instance[i].ivar = NULL;
- instance[i].svar = NULL;
+ instance[i].vars = idb_alloc(DB_OPT_RELEASE_DATA);
safestrncpy( instance[i].name, name, sizeof(instance[i].name) );
memset( instance[i].map, 0x00, sizeof(instance[i].map) );
@@ -299,14 +298,6 @@ void instance_del_map(int m)
}
/*--------------------------------------
- * Used for instance variables. Clean each variable from memory.
- *--------------------------------------*/
-void instance_destroy_freesvar(void *key, void *data, va_list args)
-{
- if( data ) aFree(data);
-}
-
-/*--------------------------------------
* Timer to destroy instance by process or idle
*--------------------------------------*/
int instance_destroy_timer(int tid, unsigned int tick, int id, intptr_t data)
@@ -342,19 +333,15 @@ void instance_destroy(int instance_id)
instance_del_map( instance[instance_id].map[0] );
}
- if( instance[instance_id].ivar )
- db_destroy(instance[instance_id].ivar);
-
- if( instance[instance_id].svar )
- db_destroy(instance[instance_id].svar);
+ if( instance[instance_id].vars )
+ db_destroy(instance[instance_id].vars);
if( instance[instance_id].progress_timer != INVALID_TIMER )
delete_timer( instance[instance_id].progress_timer, instance_destroy_timer);
if( instance[instance_id].idle_timer != INVALID_TIMER )
delete_timer( instance[instance_id].idle_timer, instance_destroy_timer);
- instance[instance_id].ivar = NULL;
- instance[instance_id].svar = NULL;
+ instance[instance_id].vars = NULL;
if( instance[instance_id].party_id && (p = party_search(instance[instance_id].party_id)) != NULL )
p->instance_id = 0; // Update Party information