This commit is contained in:
aozhiwei 2021-05-12 14:44:39 +08:00
parent 8e47e80230
commit 25b139c3da

View File

@ -603,7 +603,9 @@ Hero* Room::CreateHero(Creature* master,
{
Hero* hero = EntityFactory::Instance()->MakeHero(AllocUniid());
hero->meta = meta;
hero->master.Attach(master);
if (master) {
hero->master.Attach(master);
}
hero->room = this;
hero->SetPos(pos);
hero->SetMoveDir(dir);
@ -3788,5 +3790,21 @@ void Room::ForwardGasRing(int n)
void Room::ShuaMon(const a8::Vec2& center, std::vector<int>& airdrop_mon_list)
{
for (int hero_id : airdrop_mon_list) {
MetaData::Player* hero_meta = MetaMgr::Instance()->GetPlayer(hero_id);
if (hero_meta) {
int team_id = 666;
Creature* master = nullptr;
a8::Vec2 pos = center;
a8::Vec2 dir = center;
Hero* hero = CreateHero(master,
hero_meta,
pos,
dir,
team_id);
if (!hero) {
abort();
}
}
}
}