Issue information

Issue ID
#5126
Status
Fixed
Severity
Medium
Started
Hercules Elf Bot
Dec 18, 2011 11:52
Last Post
Hercules Elf Bot
Apr 5, 2012 8:32
Confirmation
Yes (1)
No (0)

Hercules Elf Bot - Dec 18, 2011 11:52

Originally posted by [b]Gorowann[/b]
svn trunk version 15161
in src/map/mob.c there is a little error:

[CODE]
#ifndef TXT_ONLY
if(db_use_sqldbs) {
mob_read_sqldb();
mob_read_sqlskilldb();
} else {
#endif /* TXT_ONLY */
mob_readdb();
mob_readskilldb();
}
[/CODE]
should be, if i´m not wrong:
[CODE]
#ifndef TXT_ONLY
if(db_use_sqldbs) {
mob_read_sqldb();
mob_read_sqlskilldb();
}
else { /* TXT_ONLY */
mob_readdb();
mob_readskilldb();
}
#endif
[/CODE]

Hercules Elf Bot - Dec 18, 2011 12:21

Originally posted by [b]calciumkid[/b]
I didn't think to deeply into this when I coded it-

Your fix can't be right though :S

[CODE]#ifndef TXT_ONLY [/CODE]
Means only the things within the #if would run if the compile was text only....

HOWEVER. For it to compile text only it needs to be able to use
[CODE] mob_readdb();
mob_readskilldb();[/CODE]

Which it cant if the end if is placed after the else??


I also wish to add one thing. Text support is being dropped. So this wont be overly important.

This post has been edited by calciumkid on Dec 18, 2011 12:21

Hercules Elf Bot - Dec 18, 2011 12:42

Originally posted by [b]Gorowann[/b]
but till txt ist dropped the fast to fix errors should be corrected, or there are more bugreport/ forum post will come. >.>
I´m also using sql, was never a fan of the txt version. ^^

next try... i haven´t coded for a while. *sob*
[CODE]
#ifndef TXT_ONLY
mob_read_sqldb();
mob_read_sqlskilldb();
#else /* TXT_ONLY */
mob_readdb();
mob_readskilldb();
#endif
[/CODE]

Hercules Elf Bot - Dec 18, 2011 13:11

Originally posted by [b]calciumkid[/b]
Of course, i totally forgot you could do that. This is why I'm a script developer and not a core. I have a good go though :P I thought I did okay converting the whole DB to sql.

This should be correct:

[CODE]
#ifndef TXT_ONLY
if(db_use_sqldbs) {
mob_read_sqldb();
mob_read_sqlskilldb();
} else {
mob_readdb();
mob_readskilldb();
}
#else
mob_readdb();
mob_readskilldb();
#endif /* TXT_ONLY */
[/CODE]

Now fixed.

This post has been edited by calciumkid on Dec 18, 2011 13:22

Hercules Elf Bot - Dec 18, 2011 19:21

Originally posted by [b]Brian[/b]
Changed in [rev=15163] so there is only 1 set of

[code] mob_readdb();
mob_readskilldb();
[/code]