From: <wel...@us...> - 2010-12-31 22:23:21
|
Revision: 6672 http://planeshift.svn.sourceforge.net/planeshift/?rev=6672&view=rev Author: weltall2 Date: 2010-12-31 22:23:15 +0000 (Fri, 31 Dec 2010) Log Message: ----------- last fixes now the script should work well Modified Paths: -------------- trunk/src/server/workmanager.cpp Modified: trunk/src/server/workmanager.cpp =================================================================== --- trunk/src/server/workmanager.cpp 2010-12-31 21:56:29 UTC (rev 6671) +++ trunk/src/server/workmanager.cpp 2010-12-31 22:23:15 UTC (rev 6672) @@ -3312,7 +3312,7 @@ float startQuality = transItem->GetItemQuality(); if ( process ) { - if ( result > 0 && !ApplySkills(workEvent->GetKFactor(), workEvent->GetTranformationItem(), owner, itemQty == 0, currentQuality, process) && process->GetGarbageId() != 0 ) + if ( result > 0 && !ApplySkills(workEvent->GetKFactor(), workEvent->GetTranformationItem(), owner, itemQty == 0, currentQuality, process, trans) && process->GetGarbageId() != 0 ) { result = process->GetGarbageId(); resultQty = process->GetGarbageQty(); @@ -3532,10 +3532,11 @@ } // Apply skills if any to quality and practice points -bool WorkManager::ApplySkills(float factor, psItem* transItem, gemActor *worker, bool amountModifier, float ¤tQuality, psTradeProcesses* process) +bool WorkManager::ApplySkills(float factor, psItem* transItem, gemActor *worker, bool amountModifier, float ¤tQuality, psTradeProcesses* process, psTradeTransformations* trans) { if(calc_transform_apply_skill) { + printf("using script\n"); MathEnvironment env; env.Define("Quality", currentQuality); env.Define("Factor", factor); @@ -3543,11 +3544,13 @@ env.Define("BasicObject", transItem->GetBaseStats()); env.Define("Worker", worker); env.Define("Process", process); + env.Define("Transform", trans); env.Define("Secure", secure); env.Define("AmountModifier", amountModifier); calc_transform_apply_skill->Evaluate(&env); currentQuality = env.Lookup("Quality")->GetValue(); - return (currentQuality == 0); + printf("%f\n", currentQuality); + return (currentQuality > 0); } // just return for processless transforms This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |