From: Anders R. <ma...@us...> - 2003-08-15 23:27:38
|
Update of /cvsroot/planeshift/planeshift/src/server In directory sc8-pr-cvs1:/tmp/cvs-serv26341/src/server Modified Files: spellmanager.cpp Log Message: - Added a spell name field to the glyph window. - Fixed a bug in loading of spells for a player. - Added check to prevent saving an allready known spell. - Added a glyph spell combination to the spell_glyph table. There should never be a spell without a uniq combination of one or more glyphs. - Added check to only permit glyphs to be stored in slots with the correct way. Index: spellmanager.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/spellmanager.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** spellmanager.cpp 14 Aug 2003 19:52:12 -0000 1.27 --- spellmanager.cpp 15 Aug 2003 23:13:12 -0000 1.28 *************** *** 279,291 **** void psSpellManager::SaveSpell(Client * client, csString spellName) { ! psSpell * spell = psServer::cachemanager.GetSpellByName(spellName); if (!spell) { psSystemMessage newmsg(client->GetClientNum(),MSG_INFO, ! "You can't save this spell!"); SendMessage(newmsg.msg); return; } client->GetCharacterData()->AddSpell(spell); --- 279,301 ---- void psSpellManager::SaveSpell(Client * client, csString spellName) { ! psSpell * spell = client->GetCharacterData()->GetSpellByName(spellName); ! if (spell) ! { ! psSystemMessage newmsg(client->GetClientNum(),MSG_INFO, ! "You know the spell %s allready!",spellName.GetData()); ! SendMessage(newmsg.msg); ! return; ! } ! ! spell = psServer::cachemanager.GetSpellByName(spellName); if (!spell) { psSystemMessage newmsg(client->GetClientNum(),MSG_INFO, ! "%s isn't a known spell!",spellName.GetData()); SendMessage(newmsg.msg); return; } + client->GetCharacterData()->AddSpell(spell); *************** *** 293,296 **** --- 303,309 ---- SendSpellBook(client); + psSystemMessage newmsg(client->GetClientNum(),MSG_INFO, + "%s added to you spell book!",spellName.GetData()); + SendMessage(newmsg.msg); } |