1
This commit is contained in:
parent
b2f0e4f111
commit
57df957162
@ -38,7 +38,7 @@ void Bullet::Update(int delta_time)
|
|||||||
for (auto& grid : grid_list) {
|
for (auto& grid : grid_list) {
|
||||||
for (Human* hum: grid->human_list) {
|
for (Human* hum: grid->human_list) {
|
||||||
#if 1
|
#if 1
|
||||||
if (hum != player) {
|
if (hum != player && !hum->dead) {
|
||||||
#else
|
#else
|
||||||
if (hum != player &&
|
if (hum != player &&
|
||||||
(hum->team_id == 0 || player->team_id != hum->team_id)) {
|
(hum->team_id == 0 || player->team_id != hum->team_id)) {
|
||||||
|
@ -229,9 +229,14 @@ Human* Room::FindEnemy(Human* hum)
|
|||||||
{
|
{
|
||||||
std::vector<Human*> enemys;
|
std::vector<Human*> enemys;
|
||||||
enemys.reserve(50);
|
enemys.reserve(50);
|
||||||
|
EntitySubType_e sub_type = EST_Player;
|
||||||
|
if ((rand() % 10) < 2) {
|
||||||
|
sub_type = EST_Android;
|
||||||
|
}
|
||||||
for (auto& cell : hum->grid_list) {
|
for (auto& cell : hum->grid_list) {
|
||||||
for (Human* target : cell->human_list) {
|
for (Human* target : cell->human_list) {
|
||||||
if (target->entity_subtype == EST_Player) {
|
if (target->entity_subtype == sub_type &&
|
||||||
|
!target->dead) {
|
||||||
if (hum->pos.Distance(target->pos) < 300.0f) {
|
if (hum->pos.Distance(target->pos) < 300.0f) {
|
||||||
if (target->team_id == 0 ||
|
if (target->team_id == 0 ||
|
||||||
target->team_id != hum->team_id
|
target->team_id != hum->team_id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user