This commit is contained in:
aozhiwei 2024-01-22 13:51:25 +08:00
parent ca6a1191ee
commit f013c8ac94
2 changed files with 5 additions and 3 deletions

View File

@ -1488,8 +1488,9 @@ void CallFuncBuff::Shot()
attack_dir = owner->GetAttackDir(); attack_dir = owner->GetAttackDir();
} else { } else {
GlmHelper::Normalize(attack_dir); GlmHelper::Normalize(attack_dir);
fly_distance = GlmHelper::Norm2D(target_pos - owner->GetPos().ToGlmVec3());
} }
fly_distance = std::max(1.0f, fly_distance); fly_distance = std::max(500.0f, fly_distance);
InternalShot(owner, InternalShot(owner,
owner->GetCurrWeapon()->meta, owner->GetCurrWeapon()->meta,
bullet_meta, bullet_meta,

View File

@ -454,7 +454,7 @@ void InternalShot(Creature* c,
} }
if (c->IsPlayer() || c->IsCar()) { if (c->IsPlayer() || c->IsCar()) {
#ifdef MYDEBUG #ifdef MYDEBUG
a8::XPrintf("idx:%d offset:%f,%f,%f angle:%f old_angle:%f angle_xyz:%f,%f,%f %f %f gun_muzzle_position:%f,%f,%f pos:%f,%f,%f gun_id:%d t:%d\n", a8::XPrintf("idx:%d offset:%f,%f,%f angle:%f old_angle:%f angle_xyz:%f,%f,%f %f %f gun_muzzle_position:%f,%f,%f pos:%f,%f,%f gun_id:%d t:%d fly_distance:%f\n",
{ {
bulletIdx, bulletIdx,
bullet_born_offset.x, bullet_born_offset.x,
@ -474,7 +474,8 @@ void InternalShot(Creature* c,
bullet_born_pos.y, bullet_born_pos.y,
bullet_born_pos.z, bullet_born_pos.z,
weapon_meta->id(), weapon_meta->id(),
shot_animi_time shot_animi_time,
fly_distance
}); });
#endif #endif
} }