This commit is contained in:
aozhiwei 2023-06-30 16:20:12 +08:00
parent f1fae3e31e
commit d1e88314b8
2 changed files with 7 additions and 0 deletions

View File

@ -1,6 +1,7 @@
#include "precompile.h"
#include "mt/Robot.h"
#include "mt/Hero.h"
IMPL_TABLE(mt::Robot)
@ -32,6 +33,7 @@ namespace mt
_bullet_offset.push_back(std::make_tuple(angle, _bullet_offset_rand_space));
}
}
hero_meta_ = mt::Hero::GetById(hero_id());
}
const mt::Robot* Robot::RandRobot(std::set<int>& refreshed_robot_set)
@ -39,6 +41,10 @@ namespace mt
int try_count = 0;
while (true) {
const mt::Robot* tmp_robot_meta = raw_list[rand() % raw_list.size()];
if (!tmp_robot_meta->hero_meta_ ||
!tmp_robot_meta->hero_meta_->default_weapon()){
continue;
}
#ifdef DEBUG1
if (tmp_robot_meta->hero_id() != 30300) {
continue;

View File

@ -19,6 +19,7 @@ namespace mt
private:
int _bullet_offset_rand_space = 0;
const mt::Hero* hero_meta_ = nullptr;
std::vector<std::tuple<float, int>> _bullet_offset;
};