From 4d444476b3bd9bbb2bdeaaa2d58610b2a053d1c6 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 6 Sep 2022 16:08:56 +0800 Subject: [PATCH] 1 --- server/gameserver/battledatacontext.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(); + } }