metamgr add watchable

This commit is contained in:
aozhiwei 2021-08-25 11:40:06 +08:00
parent 57caecdeb9
commit 6156cbd243
4 changed files with 10 additions and 0 deletions

View File

@ -636,6 +636,7 @@ void Human::FillSMGameOver(cs::SMGameOver& msg)
stats.rank = rank;
}
msg.set_watchable(MetaMgr::Instance()->watchable);
msg.set_team_id(team_id);
msg.set_team_rank(stats.rank);
msg.set_team_allcnt(1);

View File

@ -258,6 +258,11 @@ public:
METAMGR_READ(incubator_canset_distance, 520);
METAMGR_READ(prebattle_can_use_skill, 1);
#ifdef DEBUG
METAMGR_READ(watchable, 1);
#else
METAMGR_READ(watchable, 0);
#endif
METAMGR_READ(refresh_view_time, 4);
{

View File

@ -181,6 +181,7 @@ class MetaMgr : public a8::Singleton<MetaMgr>
int prebattle_box_id_zb = 0;
int prebattle_can_use_skill = 0;
int watchable = 0;
private:
MetaDataLoader* loader_ = nullptr;

View File

@ -914,6 +914,9 @@ void Room::AdjustPosInnerMap(a8::Vec2& pos, float radius)
Human* Room::GetWatchWarTarget(Human* hum)
{
if (!MetaMgr::Instance()->watchable) {
return nullptr;
}
if (hum->GetTeam()) {
Human* member = hum->GetTeam()->GetOneAliveMember(hum);
if (member) {