From 6ebd48675e95027a42131082d9b6c9f4738c9e33 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 30 Mar 2021 19:35:52 +0800 Subject: [PATCH] 1 --- server/gameserver/human.cc | 3 ++- server/gameserver/room.cc | 5 ++++- server/gameserver/room.h | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 0d2e4f8f..4e92da2b 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -1400,7 +1400,8 @@ void Human::SummonHero(int heroid) (this, hero_meta, GetPos(), - move_dir + move_dir, + team_id ); } } diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 1743f4f6..b1e96b3a 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -573,7 +573,8 @@ Car* Room::CreateCar(Human* driver, Hero* Room::CreateHero(Creature* master, MetaData::Player* meta, const a8::Vec2& pos, - const a8::Vec2& dir) + const a8::Vec2& dir, + int team_id) { Hero* hero = EntityFactory::Instance()->MakeHero(AllocUniid()); hero->meta = meta; @@ -581,6 +582,8 @@ Hero* Room::CreateHero(Creature* master, hero->room = this; hero->SetPos(pos); hero->move_dir = dir; + hero->attack_dir = dir; + hero->team_id = team_id; hero->Initialize(); AddToEntityHash(hero); AddToMoveableHash(hero); diff --git a/server/gameserver/room.h b/server/gameserver/room.h index d9369ad4..94446e98 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -117,7 +117,8 @@ public: Hero* CreateHero(Creature* master, MetaData::Player* meta, const a8::Vec2& pos, - const a8::Vec2& dir); + const a8::Vec2& dir, + int team_id); void OnHumanDie(Human* hum); void OnHumanRevive(Human* hum);