Duel allocation (#2734)

* Duels are now dynamically created and no longer statically consumes memory.
* Removed max number of duel at once.
* Updated duel modules for multi-thread and safer management.
* Remove various statically allocated tab.
* Removed duplicate code for npc_movenpc.
* Fix few warnings.
Thanks for suggestions from @anacondaqq.
This commit is contained in:
lighta
2017-12-27 19:39:45 -05:00
committed by Aleos
parent ae69e50626
commit 716f6c0f29
10 changed files with 174 additions and 124 deletions

View File

@@ -21520,8 +21520,8 @@ static void skill_readdb(void)
skill_changematerial_count = skill_spellbook_count = skill_magicmushroom_count = 0;
for(i=0; i<ARRAYLENGTH(dbsubpath); i++){
int n1 = strlen(db_path)+strlen(dbsubpath[i])+1;
int n2 = strlen(db_path)+strlen(DBPATH)+strlen(dbsubpath[i])+1;
size_t n1 = strlen(db_path)+strlen(dbsubpath[i])+1;
size_t n2 = strlen(db_path)+strlen(DBPATH)+strlen(dbsubpath[i])+1;
char* dbsubpath1 = (char*)aMalloc(n1+1);
char* dbsubpath2 = (char*)aMalloc(n2+1);