From: <wel...@us...> - 2010-08-01 07:15:19
|
Revision: 6109 http://planeshift.svn.sourceforge.net/planeshift/?rev=6109&view=rev Author: weltall2 Date: 2010-08-01 07:15:12 +0000 (Sun, 01 Aug 2010) Log Message: ----------- looks like i forgot the most important thing of the use tool button patch Modified Paths: -------------- trunk/src/server/actionmanager.cpp Modified: trunk/src/server/actionmanager.cpp =================================================================== --- trunk/src/server/actionmanager.cpp 2010-08-01 06:54:47 UTC (rev 6108) +++ trunk/src/server/actionmanager.cpp 2010-08-01 07:15:12 UTC (rev 6109) @@ -195,19 +195,36 @@ handled = HandleProximityQuery( topNode, client ); } - // evk: Sending to clients with security level 30+ only. - if ( !handled && client->GetSecurityLevel() >= GM_DEVELOPER ) + if ( !handled ) { - // Set target for later use - client->SetMesh(meshName); - psserver->SendSystemError(client->GetClientNum(),"You have targeted %s.",meshName.GetData()); + // evk: Sending to clients with security level 30+ only. + if(client->GetSecurityLevel() >= GM_DEVELOPER ) + { + // Set target for later use + client->SetMesh(meshName); + psserver->SendSystemError(client->GetClientNum(),"You have targeted %s.",meshName.GetData()); - // Send unhandled message to client - psMapActionMessage msg( client->GetClientNum(), psMapActionMessage::NOT_HANDLED, xml ); - if ( msg.valid ) + // Send unhandled message to client + psMapActionMessage msg( client->GetClientNum(), psMapActionMessage::NOT_HANDLED, xml ); + if ( msg.valid ) + { + msg.SendMessage(); + } + } + //send actions possible based on items on hand (probably not the best place) + else if(client->GetCharacterData()) { - msg.SendMessage(); - } + //should be done with a for checking the entire equipped inventory for now for the use we need we just + //check the two hands as a start. + psItem *item = client->GetCharacterData()->Inventory().GetInventoryItem(PSCHARACTER_SLOT_RIGHTHAND); + if(!item || !item->GetItemCommand().Length()) + item = client->GetCharacterData()->Inventory().GetInventoryItem(PSCHARACTER_SLOT_LEFTHAND); + if(item && item->GetItemCommand().Length()) + { + psGUIInteractMessage interactMsg( client->GetClientNum(), psGUIInteractMessage::GENERIC, item->GetItemCommand()); + interactMsg.SendMessage(); + } + } } } else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |