diff --git a/server/gameserver/battledatacontext.cc b/server/gameserver/battledatacontext.cc index 3ea2cbbd..9cb33be1 100644 --- a/server/gameserver/battledatacontext.cc +++ b/server/gameserver/battledatacontext.cc @@ -9,6 +9,7 @@ #include "creature.h" #include "types.h" #include "bullet.h" +#include "app.h" class HeroAbility { @@ -399,5 +400,8 @@ void BattleDataContext::ForceInit(long long hero_uniid, void BattleDataContext::Init(Creature* c) { - + owner_ = c->GetWeakPtrRef(); + if (!hero_ability_->hero_uniid_) { + hero_ability_->hero_uniid_ = App::Instance()->AllocTempHeroUniId(); + } }