This commit is contained in:
aozhiwei 2021-03-30 19:35:52 +08:00
parent d2d0d3a62c
commit 6ebd48675e
3 changed files with 8 additions and 3 deletions

View File

@ -1400,7 +1400,8 @@ void Human::SummonHero(int heroid)
(this, (this,
hero_meta, hero_meta,
GetPos(), GetPos(),
move_dir move_dir,
team_id
); );
} }
} }

View File

@ -573,7 +573,8 @@ Car* Room::CreateCar(Human* driver,
Hero* Room::CreateHero(Creature* master, Hero* Room::CreateHero(Creature* master,
MetaData::Player* meta, MetaData::Player* meta,
const a8::Vec2& pos, const a8::Vec2& pos,
const a8::Vec2& dir) const a8::Vec2& dir,
int team_id)
{ {
Hero* hero = EntityFactory::Instance()->MakeHero(AllocUniid()); Hero* hero = EntityFactory::Instance()->MakeHero(AllocUniid());
hero->meta = meta; hero->meta = meta;
@ -581,6 +582,8 @@ Hero* Room::CreateHero(Creature* master,
hero->room = this; hero->room = this;
hero->SetPos(pos); hero->SetPos(pos);
hero->move_dir = dir; hero->move_dir = dir;
hero->attack_dir = dir;
hero->team_id = team_id;
hero->Initialize(); hero->Initialize();
AddToEntityHash(hero); AddToEntityHash(hero);
AddToMoveableHash(hero); AddToMoveableHash(hero);

View File

@ -117,7 +117,8 @@ public:
Hero* CreateHero(Creature* master, Hero* CreateHero(Creature* master,
MetaData::Player* meta, MetaData::Player* meta,
const a8::Vec2& pos, const a8::Vec2& pos,
const a8::Vec2& dir); const a8::Vec2& dir,
int team_id);
void OnHumanDie(Human* hum); void OnHumanDie(Human* hum);
void OnHumanRevive(Human* hum); void OnHumanRevive(Human* hum);