From: <lpa...@us...> - 2013-11-13 12:46:48
|
Revision: 8973 http://sourceforge.net/p/planeshift/code/8973 Author: lpancallo Date: 2013-11-13 12:46:45 +0000 (Wed, 13 Nov 2013) Log Message: ----------- fixed container /use command Modified Paths: -------------- trunk/src/server/actionmanager.cpp trunk/src/server/actionmanager.h trunk/src/server/workmanager.cpp Modified: trunk/src/server/actionmanager.cpp =================================================================== --- trunk/src/server/actionmanager.cpp 2013-11-13 11:50:13 UTC (rev 8972) +++ trunk/src/server/actionmanager.cpp 2013-11-13 12:46:45 UTC (rev 8973) @@ -744,7 +744,7 @@ } // Handle /use command -void ActionManager::HandleUse(gemActionLocation* actionlocation, Client* client) +bool ActionManager::HandleUse(gemActionLocation* actionlocation, Client* client) { // find the script @@ -759,7 +759,9 @@ env.Define("Target", client->GetActor()); // needed if called by an action location bindings->Evaluate(&env); progScript->Run(&env); + return true; } + return false; } void ActionManager::HandleScriptOperation(psActionLocation* action, gemActor* actor) Modified: trunk/src/server/actionmanager.h =================================================================== --- trunk/src/server/actionmanager.h 2013-11-13 11:50:13 UTC (rev 8972) +++ trunk/src/server/actionmanager.h 2013-11-13 12:46:45 UTC (rev 8973) @@ -141,7 +141,7 @@ * Handles the /use command on an AL or the click on use button. * @param client The client that issued the use command */ - void HandleUse(gemActionLocation* actionlocation, Client* client); + bool HandleUse(gemActionLocation* actionlocation, Client* client); /** * Remove all active trigger flag for this client and action location. Modified: trunk/src/server/workmanager.cpp =================================================================== --- trunk/src/server/workmanager.cpp 2013-11-13 11:50:13 UTC (rev 8972) +++ trunk/src/server/workmanager.cpp 2013-11-13 12:46:45 UTC (rev 8973) @@ -217,14 +217,15 @@ if(msg.command == "use") { - // Check if it's an action location, then pass the job to ActionManager + // Check if it's an action location with a script, then pass the job to ActionManager gemObject* target = client->GetTargetObject(); gemActionLocation* gemAction = dynamic_cast<gemActionLocation*>(target); - if(gemAction) { - psserver->GetActionManager()->HandleUse(gemAction, client); + bool examineScript = false; + if(gemAction) + examineScript = psserver->GetActionManager()->HandleUse(gemAction, client); // otherwise let it handle to WorkManager - } else + if (!examineScript) HandleUse(client); } else if(msg.command == "combine") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |