From: Jarda B. <edh...@us...> - 2005-01-06 22:09:25
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/GUIScript In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28430/plugins/GUIScript Modified Files: GUIScript.cpp Log Message: Applied lotana's patches: #1094022: Favourite Spell/Weapon implementation fix #1094334: Favourite Weapon without a general name fix #1094395: A minor change to the "Strongest Creature Killed" line Index: GUIScript.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp,v retrieving revision 1.261 retrieving revision 1.262 diff -C2 -d -r1.261 -r1.262 *** GUIScript.cpp 4 Jan 2005 18:37:19 -0000 1.261 --- GUIScript.cpp 6 Jan 2005 22:09:05 -0000 1.262 *************** *** 3026,3030 **** // FIXME!!! if (ps->FavouriteSpells[0][0]) { ! DataStream* str = core->GetResourceMgr()->GetResource( ps->FavouriteSpells[0], IE_SPL_CLASS_ID ); SpellMgr* sm = ( SpellMgr* ) core->GetInterface( IE_SPL_CLASS_ID ); if (sm == NULL) { --- 3026,3038 ---- // FIXME!!! if (ps->FavouriteSpells[0][0]) { ! int largest = 0; ! ! for (int i = 1; i < 4; ++i) { ! if (ps->FavouriteSpellsCount[i] > ps->FavouriteSpellsCount[largest]) { ! largest = i; ! } ! } ! ! DataStream* str = core->GetResourceMgr()->GetResource( ps->FavouriteSpells[largest], IE_SPL_CLASS_ID ); SpellMgr* sm = ( SpellMgr* ) core->GetInterface( IE_SPL_CLASS_ID ); if (sm == NULL) { *************** *** 3056,3060 **** // FIXME!!! if (ps->FavouriteWeapons[0][0]) { ! DataStream* str = core->GetResourceMgr()->GetResource( ps->FavouriteWeapons[0], IE_ITM_CLASS_ID ); ItemMgr* sm = ( ItemMgr* ) core->GetInterface( IE_ITM_CLASS_ID ); if (sm == NULL) { --- 3064,3076 ---- // FIXME!!! if (ps->FavouriteWeapons[0][0]) { ! int largest = 0; ! ! for (int i = 1; i < 4; ++i) { ! if (ps->FavouriteWeaponsCount[i] > ps->FavouriteWeaponsCount[largest]) { ! largest = i; ! } ! } ! ! DataStream* str = core->GetResourceMgr()->GetResource( ps->FavouriteWeapons[largest], IE_ITM_CLASS_ID ); ItemMgr* sm = ( ItemMgr* ) core->GetInterface( IE_ITM_CLASS_ID ); if (sm == NULL) { *************** *** 3074,3078 **** ! PyDict_SetItemString(dict, "FavouriteWeapon", PyInt_FromLong (item->ItemName)); sm->ReleaseItem( item ); --- 3090,3099 ---- ! if (*core->GetString (item->ItemName) == 0) { ! PyDict_SetItemString(dict, "FavouriteWeapon", PyInt_FromLong (item->ItemNameIdentified)); ! } ! else { ! PyDict_SetItemString(dict, "FavouriteWeapon", PyInt_FromLong (item->ItemName)); ! } sm->ReleaseItem( item ); |