1
This commit is contained in:
parent
f1fae3e31e
commit
d1e88314b8
@ -1,6 +1,7 @@
|
|||||||
#include "precompile.h"
|
#include "precompile.h"
|
||||||
|
|
||||||
#include "mt/Robot.h"
|
#include "mt/Robot.h"
|
||||||
|
#include "mt/Hero.h"
|
||||||
|
|
||||||
IMPL_TABLE(mt::Robot)
|
IMPL_TABLE(mt::Robot)
|
||||||
|
|
||||||
@ -32,6 +33,7 @@ namespace mt
|
|||||||
_bullet_offset.push_back(std::make_tuple(angle, _bullet_offset_rand_space));
|
_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)
|
const mt::Robot* Robot::RandRobot(std::set<int>& refreshed_robot_set)
|
||||||
@ -39,6 +41,10 @@ namespace mt
|
|||||||
int try_count = 0;
|
int try_count = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
const mt::Robot* tmp_robot_meta = raw_list[rand() % raw_list.size()];
|
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
|
#ifdef DEBUG1
|
||||||
if (tmp_robot_meta->hero_id() != 30300) {
|
if (tmp_robot_meta->hero_id() != 30300) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -19,6 +19,7 @@ namespace mt
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int _bullet_offset_rand_space = 0;
|
int _bullet_offset_rand_space = 0;
|
||||||
|
const mt::Hero* hero_meta_ = nullptr;
|
||||||
std::vector<std::tuple<float, int>> _bullet_offset;
|
std::vector<std::tuple<float, int>> _bullet_offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user