From 6b9a408b463c3a130896af83f31f67c5e0887706 Mon Sep 17 00:00:00 2001 From: Natedog2012 Date: Tue, 23 Sep 2014 19:10:52 -0700 Subject: [PATCH] Don't allow AA to be bought that you cant use --- zone/aa.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zone/aa.cpp b/zone/aa.cpp index ba61c9005..9cb6cf43f 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -988,13 +988,20 @@ void Client::BuyAA(AA_Action* action) } uint32 real_cost; + uint8 req_level; std::map::iterator RequiredLevel = AARequiredLevelAndCost.find(action->ability); if(RequiredLevel != AARequiredLevelAndCost.end()) { real_cost = RequiredLevel->second.Cost; + req_level = RequiredLevel->second.Level; } - else + else { real_cost = aa2->cost + (aa2->cost_inc * cur_level); + req_level = aa2->class_type + (aa2->level_inc * cur_level); + } + + if (req_level > GetLevel()) + return; //Cheater trying to Buy AA... if (m_pp.aapoints >= real_cost && cur_level < aa2->max_level) { SetAA(aa2->id, cur_level + 1);