This commit is contained in:
aozhiwei 2024-01-03 11:31:17 +08:00
parent 68732083e0
commit c28a28c7fd
5 changed files with 10 additions and 20 deletions

View File

@ -1160,6 +1160,14 @@ int BattleDataContext::GetHeroLevel()
return std::max(hero_lv_, 1); return std::max(hero_lv_, 1);
} }
int BattleDataContext::GetHeroId()
{
if (hero_ability_) {
return hero_ability_->hero_meta->id();
}
A8_ABORT();
}
bool BattleDataContext::IsMainSkill(Skill* skill) bool BattleDataContext::IsMainSkill(Skill* skill)
{ {
if (skill->meta->_base_skill_meta) { if (skill->meta->_base_skill_meta) {

View File

@ -81,6 +81,7 @@ struct BattleDataContext
int GetSkinId(); int GetSkinId();
int GetLevel(); int GetLevel();
int GetHeroId();
int GetHeroLevel(); int GetHeroLevel();
bool IsMainSkill(Skill* skill); bool IsMainSkill(Skill* skill);
int GetCurrentGetStar(); int GetCurrentGetStar();

View File

@ -2428,6 +2428,7 @@ int Room::InitWithMobaBattle(long ip_saddr, int socket_handle, std::shared_ptr<c
join_msg.set_avatar_url(m->GetAvatarUrl()); join_msg.set_avatar_url(m->GetAvatarUrl());
join_msg.set_head_frame(m->GetHeadFrame()); join_msg.set_head_frame(m->GetHeadFrame());
join_msg.set_sex(m->GetSex()); join_msg.set_sex(m->GetSex());
join_msg.set_hero_id(m->GetNetData()->GetHeroId());
#endif #endif
PlayerMgr::Instance()-> PlayerMgr::Instance()->
CreatePlayerByCMJoin(hum, CreatePlayerByCMJoin(hum,

View File

@ -124,7 +124,6 @@ void Room::Init()
f8::BtMgr::Instance()->BtLoad(room_agent_, "npc/room"); f8::BtMgr::Instance()->BtLoad(room_agent_, "npc/room");
f8::BtMgr::Instance()->BtSetCurrent(room_agent_, "npc/room"); f8::BtMgr::Instance()->BtSetCurrent(room_agent_, "npc/room");
CreateSpawnPoints();
CreateWorldObjects(); CreateWorldObjects();
ShuaAndroid(); ShuaAndroid();
incubator_ = std::make_shared<Incubator>(); incubator_ = std::make_shared<Incubator>();
@ -2262,24 +2261,6 @@ std::shared_ptr<BornPoint> Room::GetBornPoint(int point_uniid)
return itr != born_point_hash_.end() ? itr->second : nullptr; return itr != born_point_hash_.end() ? itr->second : nullptr;
} }
void Room::CreateSpawnPoints()
{
#if 0
if (born_point_hash_.empty()) {
for (size_t i = 0; i < 10; ++i) {
int uniid = AllocUniid();
std::shared_ptr<BornPoint> born_point = std::make_shared<BornPoint>();
born_point_hash_[uniid] = born_point;
if (IsPveRoom()) {
std::shared_ptr<mt::WorldObject> wo_meta = std::make_shared<mt::WorldObject>();
wo_meta->pos = pve_instance->_spawn_point;
born_point->wo_meta = wo_meta;
}
}
}
#endif
}
void Room::IncBornPointHumanNum(std::shared_ptr<BornPoint> point, Human* hum) void Room::IncBornPointHumanNum(std::shared_ptr<BornPoint> point, Human* hum)
{ {
switch (hum->GetEntitySubType()) { switch (hum->GetEntitySubType()) {

View File

@ -308,7 +308,6 @@ private:
void RandRemoveAndroid(); void RandRemoveAndroid();
std::shared_ptr<BornPoint> AllocBornPoint(Human* hum); std::shared_ptr<BornPoint> AllocBornPoint(Human* hum);
std::shared_ptr<BornPoint> GetBornPoint(int point_uniid); std::shared_ptr<BornPoint> GetBornPoint(int point_uniid);
void CreateSpawnPoints();
void CreateWorldObjects(); void CreateWorldObjects();
void IncBornPointHumanNum(std::shared_ptr<BornPoint> point, Human* hum); void IncBornPointHumanNum(std::shared_ptr<BornPoint> point, Human* hum);
void DecBornPointHumanNum(std::shared_ptr<BornPoint> point, Human* hum); void DecBornPointHumanNum(std::shared_ptr<BornPoint> point, Human* hum);