This commit is contained in:
aozhiwei 2024-02-15 11:42:20 +08:00
parent 1f7fefe527
commit d8f71de4c5
2 changed files with 14 additions and 1 deletions

View File

@ -142,6 +142,13 @@ void Bullet::OnHit(std::set<Entity*>& objects)
if (!room->BulletCanReach(born_pos.ToGlmVec3(), target->GetPos().ToGlmVec3())) {
eat = true;
}
if (gun_meta->id() == 30905 && eat && sender.Get()) {
glm::vec3 new_born_pos = born_pos.ToGlmVec3();
new_born_pos.y = target->GetPos().GetY();
if (room->BulletCanReach(new_born_pos, target->GetPos().ToGlmVec3())) {
eat = false;
}
}
if (sender.Get() && sender.Get()->IsPlayer()) {
#ifdef MYDEBUG
a8::XPrintf("eat %d xxxxxxxxxxxxxxxxxxxxxxxx\n", {eat});
@ -933,6 +940,9 @@ void Bullet::GetHitCreatures(BulletCheckResult& result)
}
} else {
result.objects.insert(c);
#ifdef MYDEBUG1
a8::XPrintf("GetHitCreatures gun_id:%d\n", {gun_meta->id()});
#endif
if (gun_meta->ispenetrate()) {
++result.c_hit_num;
hit_objects_.insert(c->GetUniId());
@ -1027,6 +1037,9 @@ float Bullet::GetHitRadius()
hit_radius = GetExplosionRange();
}
}
if (gun_meta->id() == 30905) {
hit_radius = 20;
}
return hit_radius;
}

View File

@ -14,7 +14,7 @@
#include "mt/MapThing.h"
#include "mt/Hero.h"
static const float GUN_HEIGHT = 10.0f;
static const float GUN_HEIGHT = 20.0f;
bool Collision::CheckBullet(IBullet* bullet, Creature* c)
{