diff options
-rw-r--r-- | Changelog-Trunk.txt | 2 | ||||
-rw-r--r-- | src/map/mapreg_sql.c | 15 |
2 files changed, 6 insertions, 11 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 999c68be1..a88ecfed6 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,8 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. +2009/11/20 + * Cleaned up mapreg dirty-marking code to only mark the mapreg as dirty when it actually is. (bugreport:3735) [Paradox924X] 2009/11/19 * Applied the renewal client support patch from Diablo (eA forum topic 222623). By default eA still supports sakexe/ragexe clients. In order to support the diff --git a/src/map/mapreg_sql.c b/src/map/mapreg_sql.c index 89951fb76..e32ab30f9 100644 --- a/src/map/mapreg_sql.c +++ b/src/map/mapreg_sql.c @@ -43,11 +43,8 @@ bool mapreg_setreg(int uid, int val) if( val != 0 ) { if( idb_put(mapreg_db,uid,(void*)val) ) - ; // already exists, delay write - else - if( name[1] == '@' ) - ; // nothing more to do - else + mapreg_dirty = true; // already exists, delay write + else if(name[1] != '@') { {// write new wariable to database char tmp_str[32*2+1]; Sql_EscapeStringLen(mmysql_handle, tmp_str, name, strnlen(name, 32)); @@ -59,16 +56,13 @@ bool mapreg_setreg(int uid, int val) { idb_remove(mapreg_db,uid); - if( name[1] == '@' ) - ; // nothing more to do - else + if( name[1] != '@' ) {// Remove from database because it is unused. if( SQL_ERROR == Sql_Query(mmysql_handle, "DELETE FROM `%s` WHERE `varname`='%s' AND `index`='%d'", mapreg_table, name, i) ) Sql_ShowDebug(mmysql_handle); } } - mapreg_dirty = true; return true; } @@ -90,7 +84,7 @@ bool mapreg_setregstr(int uid, const char* str) else { if (idb_put(mapregstr_db,uid, aStrdup(str))) - ; + mapreg_dirty = true; else if(name[1] != '@') { //put returned null, so we must insert. // Someone is causing a database size infinite increase here without name[1] != '@' [Lance] char tmp_str[32*2+1]; @@ -102,7 +96,6 @@ bool mapreg_setregstr(int uid, const char* str) } } - mapreg_dirty = true; return true; } |