From: Anders R. <ma...@us...> - 2003-04-22 19:58:34
|
Update of /cvsroot/planeshift/planeshift/src/server In directory sc8-pr-cvs1:/tmp/cvs-serv9555/src/server Modified Files: spellmanager.cpp spellmanager.h Log Message: - Inserted handling of the cast command from the spell book window. - Don't send view item from merchant window with "empty" item name. Index: spellmanager.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/spellmanager.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** spellmanager.cpp 20 Apr 2003 23:00:51 -0000 1.1 --- spellmanager.cpp 22 Apr 2003 19:57:56 -0000 1.2 *************** *** 139,142 **** --- 139,176 ---- break; } + case psGUISpellBookMessage::CAST: + { + psXMLString mainString (msg.commandData); + psXMLTag tag(mainString,0); + + csString name; + tag.GetTagParm("NAME",name); + psSpell * spell = FindSpell(name); + if (spell) + { + // TODO: Include check to see if character have this spell. + + if (spell->Cast(this,client)) + { + psSystemMessage newmsg(client->GetClientNum(),MSG_INFO, + "You start casting spell %s", + name.GetData()); + SendMessage(newmsg.msg); + } + else + { + psSystemMessage newmsg(client->GetClientNum(),MSG_INFO, + "Failed to cast spell %s", + name.GetData()); + SendMessage(newmsg.msg); + } + } + else + { + Warning2("Can't find spell %s", name.GetData()); + } + + break; + } } *************** *** 219,222 **** --- 253,262 ---- { } + + bool psSpell::Cast(psSpellManager * spellManager, Client * client) + { + return false; + } + csString psSpell::spellToXML() const Index: spellmanager.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/spellmanager.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** spellmanager.h 22 Apr 2003 03:15:46 -0000 1.2 --- spellmanager.h 22 Apr 2003 19:57:56 -0000 1.3 *************** *** 77,80 **** --- 77,82 ---- const csString& GetImage() const { return image; } const csString& GetDescription() const { return description; } + + bool Cast(psSpellManager * spellManager, Client * client); csString spellToXML() const; |