This commit is contained in:
aozhiwei 2022-09-06 16:03:07 +08:00
parent d7ae16f29e
commit 732a58ec91
7 changed files with 10 additions and 2 deletions

View File

@ -44,6 +44,7 @@ void Android::Initialize()
0,
nullptr
);
GetBattleContext()->Init(this);
}
}

View File

@ -397,7 +397,7 @@ void BattleDataContext::ForceInit(long long hero_uniid,
}
}
void BattleDataContext::Init()
void BattleDataContext::Init(Creature* c)
{
}

View File

@ -1,5 +1,6 @@
#pragma once
#include "weakptr.h"
/*
@ -61,7 +62,7 @@ struct BattleDataContext
MetaData::Equip* weapon1_meta,
long long weapon2_uniid,
MetaData::Equip* weapon2_meta);
void Init();
void Init(Creature* c);
private:
void Clear();
@ -79,6 +80,7 @@ private:
std::shared_ptr<WeaponAbility> GetWeaponByUniId(long long weapon_uniid);
private:
CreatureWeakPtr owner_;
std::shared_ptr<HeroAbility> hero_ability_;
std::shared_ptr<WeaponAbility> weapon1_ability_;

View File

@ -65,6 +65,7 @@ void Car::Initialize()
0,
nullptr
);
GetBattleContext()->Init(this);
}
}

View File

@ -61,6 +61,7 @@ void Hero::Initialize()
0,
nullptr
);
GetBattleContext()->Init(this);
}
}

View File

@ -4084,7 +4084,9 @@ void Room::AddTeam(class MatchTeam* team)
}
hum->room = this;
AddPlayer(hum, init_born_point, true);
hum->SetBattleContext(member->battle_context);
hum->GetBattleContext()->Init(hum);
hum->ProcPrepareItems(msg.prepare_items());
hum->ProcPrepareItems2(msg.prepare_items2());
hum->ProcSkillList(msg.skill_list());

View File

@ -202,6 +202,7 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
hum->room = room;
room->AddPlayer(hum);
hum->SetBattleContext(results.at(0));
hum->GetBattleContext()->Init(hum);
hum->ProcPrepareItems(msg.prepare_items());
hum->ProcPrepareItems2(msg.prepare_items2());
hum->ProcSkillList(msg.skill_list());