This commit is contained in:
aozhiwei 2024-01-15 10:59:42 +08:00
parent aa29a33b97
commit 20de4d231c

View File

@ -47,6 +47,7 @@
#include "mt/MapThing.h"
#include "mt/Text.h"
#include "mt/Map.h"
#include "mt/BattleHeroGrow.h"
#include "buff/sprint.h"
@ -3931,7 +3932,17 @@ void Creature::AdjustMobaBornDir()
void Creature::SetHeroLevel(int level, int exp, const mt::BattleHeroGrow* grow_meta)
{
for (int buff_uniid : grow_buff_list_) {
RemoveBuffByUniId(buff_uniid);
}
grow_buff_list_.clear();
for (auto handle : grow_attr_list_) {
GetAbility()->RemoveAttr(handle);
}
grow_attr_list_.clear();
hero_level_ = level;
hero_exp_ = exp;
hero_grow_meta_ = grow_meta;
}
int Creature::GetHeroLevel()
@ -3946,5 +3957,8 @@ int Creature::GetHeroExp()
int Creature::GetHeroMaxExp()
{
if (hero_grow_meta_) {
return hero_grow_meta_->levelExp();
}
return -1;
}