This commit is contained in:
aozhiwei 2022-10-20 16:04:23 +08:00
parent bc1a675e41
commit 0ac45cd1e7
2 changed files with 8 additions and 6 deletions

View File

@ -84,11 +84,12 @@ void Bullet::OnHit(std::set<Entity*>& objects)
if (IsFlyHook()) { if (IsFlyHook()) {
if (sender.Get() && !sender.Get()->dead) { if (sender.Get() && !sender.Get()->dead) {
for (auto& target : objects) { for (auto& target : objects) {
if ( Creature* c = target->IsCreature(room) ? (Creature*)target : nullptr;
!(target->IsCreature(room) && if (!(c && c->IsCar())) {
((Creature*)target)->IsCar())) {
ProcFlyHook(target); ProcFlyHook(target);
target->OnBulletHit(this); if (!c || (c->team_id != sender.Get()->team_id)) {
target->OnBulletHit(this);
}
} }
break; break;
} }
@ -535,7 +536,8 @@ void Bullet::Check(float distance)
GetGridList(), GetGridList(),
[this, &objects, &c_hit_num, &eat] (Creature* c, bool& stop) [this, &objects, &c_hit_num, &eat] (Creature* c, bool& stop)
{ {
if (sender.Get()->IsProperTarget(c)) { bool no_teammate = !IsFlyHook();
if (sender.Get()->IsProperTarget(c, no_teammate)) {
if (gun_meta->i->ispenetrate() && if (gun_meta->i->ispenetrate() &&
hit_objects_.find(c->GetUniId()) != hit_objects_.end()) { hit_objects_.find(c->GetUniId()) != hit_objects_.end()) {
//穿人 //穿人

View File

@ -414,7 +414,7 @@ void Incubator::NextWave()
cs::SMPvePassWave notify_msg; cs::SMPvePassWave notify_msg;
int next_wave = hum->room->pve_data.GetWave() + 1 + 1; int next_wave = hum->room->pve_data.GetWave() + 1 + 1;
int max_wave = room->pve_data.max_wave; int max_wave = room->pve_data.max_wave;
next_wave = std::max(next_wave, max_wave); next_wave = std::min(next_wave, max_wave);
notify_msg.set_new_wave(next_wave); notify_msg.set_new_wave(next_wave);
notify_msg.set_wait_time(hum->room->pve_mode_meta->pb->wave_prepare_time()); notify_msg.set_wait_time(hum->room->pve_mode_meta->pb->wave_prepare_time());
notify_msg.set_pve_max_wave(max_wave); notify_msg.set_pve_max_wave(max_wave);