PDA

View Full Version : Bots/Linux compile error


John Adams
10-11-2009, 01:40 PM
Whomever,

Searched for my specific error here and found nothing, so hopefully it's not redundant.

Compiling latest SVN on Ubuntu x86 (no gui) and I end up with what looks like 3 errors when the -DEQBOTS is defined.

make -C zone
make[1]: Entering directory `/home/eqemu/src/EQ/zone'
gcc -c -fpermissive -Wall -Wuninitialized -Wwrite-strings -Wcast-qual -Wno-deprecated -Wcomment -Wcast-align -O -g -march=i686 -pthread -pipe -D_GNU_SOURCE -DINVERSEXY -DFX -DZONE -DEQDEBUG=5 -DCATCH_CRASH -DNO_PIDLOG -DSHAREMEM -DFIELD_ITEMS -DCOMBINED -DAPP_OPCODE_SIZE=2 -Di386 -DEQBOTS -DEMBPERL -DEMBPERL_PLUGIN -DHAS_UNION_SEMUN -I/usr/include/mysql -DBIG_JOINS=1 -fPIC -fno-strict-aliasing -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.10/CORE spells.cpp -o spells.o
spells.cpp: In member function âvoid Mob::BardPulse(uint16, Mob*)â:
spells.cpp:1847: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âint Mob::AddBuff(Mob*, int16, int, sint32)â:
spells.cpp:2348: warning: comparison between signed and unsigned integer expressions
spells.cpp:2380: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âint Mob::CanBuffStack(int16, int8, bool)â:
spells.cpp:2466: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âbool Mob::FindBuff(int16)â:
spells.cpp:2999: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âvoid Mob::BuffFadeAll()â:
spells.cpp:3009: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âvoid Mob::BuffFadeDetrimental()â:
spells.cpp:3018: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âvoid Mob::BuffFadeDetrimentalByCaster(Mob*)â:
spells.cpp:3031: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âvoid Mob::BuffFadeBySpellID(int16)â:
spells.cpp:3048: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âvoid Mob::BuffFadeByEffect(int, int)â:
spells.cpp:3063: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âfloat Mob::ResistSpell(int8, int16, Mob*)â:
spells.cpp:3382: error: âclass Mobâ has no member named âIsBotâ
spells.cpp:3386: error: âclass Mobâ has no member named âGetBotFocusEffectâ
spells.cpp:3386: error: âbotfocusResistRateâ was not declared in this scope
spells.cpp: In member function âvoid Client::MemSpell(int16, int, bool)â:
spells.cpp:3663: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âvoid Client::UnmemSpell(int, bool)â:
spells.cpp:3684: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âvoid Client::UnmemSpellAll(bool)â:
spells.cpp:3700: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âvoid Client::ScribeSpell(int16, int, bool)â:
spells.cpp:3708: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âvoid Client::UnscribeSpell(int, bool)â:
spells.cpp:3729: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âvoid Client::UnscribeSpellAll(bool)â:
spells.cpp:3750: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âint Client::GetNextAvailableSpellBookSlot(int)â:
spells.cpp:3758: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âint Client::FindSpellBookSlotBySpellID(int16)â:
spells.cpp:3767: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âsint8 Mob::GetBuffSlotFromType(int8)â:
spells.cpp:4134: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âbool Mob::FindType(int8, bool, int16)â:
spells.cpp:4147: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âbool Mob::UseBardSpellLogic(int16, int)â:
spells.cpp:4300: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âvoid Mob::SendPetBuffsToClient()â:
spells.cpp:4377: warning: comparison between signed and unsigned integer expressions
spells.cpp: In member function âvoid Mob::BuffModifyDurationBySpellID(int16, sint32)â:
spells.cpp:4392: warning: comparison between signed and unsigned integer expressions
make[1]: *** [spells.o] Error 1
make[1]: Leaving directory `/home/eqemu/src/EQ/zone'
make: *** [all] Error 2

Any help would be appreciated.

Shin Noir
10-11-2009, 02:00 PM
Perhaps try this:
Edit spells.cpp and go to the line it says, 3382
and change it from :

if(caster && caster->IsBot())

to:

if(caster && caster->CastToNPC()->IsBot())


Same with 3386
from:

sint32 focusResist = caster->GetBotFocusEffect(botfocusResistRate, spell_id);
To:

sint32 focusResist = caster->CastToBot()->GetBotFocusEffect(12, spell_id);

Since when the bot class gets declared, it's 'class Bot : public NPC {' I think if you cast it over to NPC it should work alright for the IsBot() function, then for the Focus Effect the check is made prior to see if it's a bot or not, so shold be safe to cast it to bot...
botfocusResistRate is just an enumerator for the value of 12, and since it's giving you issues I just temp fixed it with that value.

Anyways, let me know if it compiles. Seems ubuntu's gcc compiler is being more anal receptive than VS2k8

John Adams
10-11-2009, 02:05 PM
Awesome, thanks for the quick tip. I was just coming back here to say, my VS2008 compile crapped out in the same place. I added EQBOTS to the compile pre-processor, too.

I'll try your suggestion on these.



Edit: On the VS2k8, now it is complaining that IsBot is not a member of NPC heh. Oh well, Bots are not for me yet. I'll keep waiting.

Shin Noir
10-11-2009, 02:11 PM
virtual bool IsBot() const { return true; }
should be in bot.h line 219.. o.o
weird @ your errors! :D

John Adams
10-11-2009, 02:23 PM
How about line 198? :D

John Adams
10-11-2009, 02:25 PM
Err, should the preprocessor define be just "BOTS"? I see an ifdef BOTS, not EQBOTS.

pfyon
10-11-2009, 02:34 PM
Yeah, it's just -DBOTS since we switched from the old system to the new one.

Should compile without any changes afterwards (as of rev 1008).