mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
AAs should load from character data now, though will be fucked up if you already had stacked aas.
This commit is contained in:
+28
-27
@@ -4077,33 +4077,34 @@ XS(XS_Client_RefundAA) {
|
||||
if(THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
int curpt = 0;
|
||||
bool refunded = false;
|
||||
|
||||
for(int x1=0;x1<aaHighestID;x1++){
|
||||
curpt = THIS->GetAA(x1);
|
||||
if(curpt > 0){
|
||||
SendAA_Struct* curaa = zone->FindAA(x1);
|
||||
if(curaa){
|
||||
THIS->SetAA(x1, 0);
|
||||
for(int x2=0;x2<curpt;x2++){ //add up all the AA points pt by pt to get the correct cost
|
||||
THIS->GetPP().aapoints += curaa->cost + (curaa->cost_inc * x2);
|
||||
refunded = true;
|
||||
}
|
||||
}
|
||||
else //aa doesn't exist.. but if they bought it then it had at least a cost of 1 point each
|
||||
{ //so give back what we can
|
||||
THIS->GetPP().aapoints += curpt;
|
||||
THIS->SetAA(x1, 0);
|
||||
refunded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(refunded){
|
||||
THIS->Save(); //save of course
|
||||
THIS->Kick(); //client gets all buggy if we don't immediatly relog so just force it on them
|
||||
}
|
||||
//old aa
|
||||
//int curpt = 0;
|
||||
//bool refunded = false;
|
||||
//
|
||||
//for(int x1=0;x1<aaHighestID;x1++){
|
||||
// curpt = THIS->GetAA(x1);
|
||||
// if(curpt > 0){
|
||||
// SendAA_Struct* curaa = zone->FindAA(x1);
|
||||
// if(curaa){
|
||||
// THIS->SetAA(x1, 0);
|
||||
// for(int x2=0;x2<curpt;x2++){ //add up all the AA points pt by pt to get the correct cost
|
||||
// THIS->GetPP().aapoints += curaa->cost + (curaa->cost_inc * x2);
|
||||
// refunded = true;
|
||||
// }
|
||||
// }
|
||||
// else //aa doesn't exist.. but if they bought it then it had at least a cost of 1 point each
|
||||
// { //so give back what we can
|
||||
// THIS->GetPP().aapoints += curpt;
|
||||
// THIS->SetAA(x1, 0);
|
||||
// refunded = true;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//if(refunded){
|
||||
// THIS->Save(); //save of course
|
||||
// THIS->Kick(); //client gets all buggy if we don't immediatly relog so just force it on them
|
||||
//}
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user