|
From: Chad M. <cmm...@us...> - 2005-05-10 15:42:43
|
Update of /cvsroot/seq/showeq/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9826/src Modified Files: Tag: pre_5_0_beta interface.cpp player.cpp Log Message: Fixed alt exp updated to be properly process. Made the statur bar alt-exp message more useful (showing percent) also. Index: player.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/player.cpp,v retrieving revision 1.42.6.10 retrieving revision 1.42.6.11 diff -u -d -r1.42.6.10 -r1.42.6.11 --- player.cpp 7 Apr 2005 03:19:37 -0000 1.42.6.10 +++ player.cpp 10 May 2005 15:42:08 -0000 1.42.6.11 @@ -573,6 +573,10 @@ { const altExpUpdateStruct* altexp = (const altExpUpdateStruct*)data; + /* purple: I got no idea what is up here. This seems to be written like + * the packet from the server gives the entire exp bump and not + * just the proper percent. This makes it behave funny. Taking out + * the multiply by percent here. uint32_t realExp = altexp->altexp * altexp->percent * (15000000 / 33000); uint32_t expIncrement; @@ -580,6 +584,18 @@ expIncrement = realExp - m_currentAltExp; else expIncrement = 0; + */ + uint32_t realExp = altexp->altexp * (15000000 / 33000); + uint32_t expIncrement; + + if (realExp > m_currentExp) + { + expIncrement = realExp - m_currentAltExp; + } + else + { + expIncrement = 0; + } m_currentAApts = altexp->aapoints; m_currentAltExp = realExp; Index: interface.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/interface.cpp,v retrieving revision 1.67.6.13 retrieving revision 1.67.6.14 diff -u -d -r1.67.6.13 -r1.67.6.14 --- interface.cpp 7 Apr 2005 03:19:35 -0000 1.67.6.13 +++ interface.cpp 10 May 2005 15:42:02 -0000 1.67.6.14 @@ -2077,6 +2077,9 @@ m_packet->connect2("OP_ExpUpdate", SP_Zone, DIR_Server, "expUpdateStruct", SZC_Match, m_player, SLOT(updateExp(const uint8_t*))); + m_packet->connect2("OP_AAExpUpdate", SP_Zone, DIR_Server, + "altExpUpdateStruct", SZC_Match, + m_player, SLOT(updateAltExp(const uint8_t*))); m_packet->connect2("OP_LevelUpdate", SP_Zone, DIR_Server, "levelUpUpdateStruct", SZC_Match, m_player, SLOT(updateLevel(const uint8_t*))); @@ -2098,10 +2101,6 @@ m_packet->connect2("OP_SwapSpell", SP_Zone, DIR_Server, "tradeSpellBookSlotsStruct", SZC_Match, m_player, SLOT(tradeSpellBookSlots(const uint8_t*, size_t, uint8_t))); -#if 0 // ZBTEMP - connect(m_packet, SIGNAL(updateAltExp(const uint8_t*, size_t, uint8_t)), - m_player, SLOT(updateAltExp(const uint8_t*))); -#endif // interface statusbar slots connect (this, SIGNAL(newZoneName(const QString&)), @@ -4369,8 +4368,13 @@ uint32_t aapoints) { if (m_stsbarExpAA) - m_stsbarExpAA->setText(QString("ExpAA: %1 (%2/330)") - .arg(Commanate(totalExp)).arg(totalTick)); + { + char aaperc[5]; + sprintf(aaperc, "%.2f", totalExp*100.0/maxExp); + + m_stsbarExpAA->setText(QString("ExpAA: %1 (%2/330, %3%)") + .arg(Commanate(totalExp)).arg(totalTick).arg(aaperc)); + } } void EQInterface::levelChanged(uint8_t level) |