From 4f3156b78f807553b11f37a7d0c898f6e358495b Mon Sep 17 00:00:00 2001 From: Haru Date: Mon, 24 Feb 2014 17:35:23 +0100 Subject: Ref redesign, part 3 - Updated several functions to properly use the data structures defined in parts 1 and 2. - Special thanks to Ind for his help on this, as well as the previous two parts. - Fixes some crashes related to variable references passed back and forth between nested callfunc/callsub scopes (related: 2669e9a, 3259f89, 4f2de07) Signed-off-by: Haru --- src/map/mapreg_sql.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/map/mapreg_sql.c') diff --git a/src/map/mapreg_sql.c b/src/map/mapreg_sql.c index bdda652b8..61c25f24e 100644 --- a/src/map/mapreg_sql.c +++ b/src/map/mapreg_sql.c @@ -64,7 +64,7 @@ bool mapreg_setreg(int64 uid, int val) { } } else { if( i ) - script->array_update(&mapreg->regs.arrays, uid, false); + script->array_update(&mapreg->regs, uid, false); m = ers_alloc(mapreg->ers, struct mapreg_save); @@ -83,7 +83,7 @@ bool mapreg_setreg(int64 uid, int val) { } } else { // val == 0 if( i ) - script->array_update(&mapreg->regs.arrays, uid, true); + script->array_update(&mapreg->regs, uid, true); if( (m = i64db_get(mapreg->regs.vars, uid)) ) { ers_free(mapreg->ers, m); } @@ -113,7 +113,7 @@ bool mapreg_setregstr(int64 uid, const char* str) { if( str == NULL || *str == 0 ) { if( i ) - script->array_update(&mapreg->regs.arrays, uid, true); + script->array_update(&mapreg->regs, uid, true); if(name[1] != '@') { if( SQL_ERROR == SQL->Query(map->mysql_handle, "DELETE FROM `%s` WHERE `varname`='%s' AND `index`='%d'", mapreg->table, name, i) ) Sql_ShowDebug(map->mysql_handle); @@ -135,7 +135,7 @@ bool mapreg_setregstr(int64 uid, const char* str) { } } else { if( i ) - script->array_update(&mapreg->regs.arrays, uid, false); + script->array_update(&mapreg->regs, uid, false); m = ers_alloc(mapreg->ers, struct mapreg_save); -- cgit v1.2.3-60-g2f50