This commit is contained in:
aozhiwei 2021-03-08 20:00:44 +08:00
parent 07306fe97e
commit 193073bf9d
5 changed files with 10 additions and 6 deletions

View File

@ -586,16 +586,12 @@ bool Human::IsCollisionInMapService()
case ET_Obstacle:
{
Obstacle* obstacle = (Obstacle*)collider->owner;
#if 1
if (!obstacle->IsDead(room) &&
(
(collider->type == CT_Aabb && aabb_box.Intersect((ColliderComponent*)collider)) ||
(collider->type == CT_Circle && self_collider_->Intersect((ColliderComponent*)collider))
)
) {
#else
if (!collider->owner->dead && TestCollision((ColliderComponent*)collider)) {
#endif
) &&
!obstacle->CanThroughable(this)) {
if (last_collision_door_ != collider->owner) {
if (!obstacle->IsDead(room) &&
obstacle->Attackable() &&

View File

@ -37,6 +37,7 @@ class Obstacle : public Entity
virtual long long GetDeadFrameNo(Room* room) override;
virtual void OnPreCollision(Room* room) override;
virtual bool IsTerminatorAirDropBox(Room* room) { return false; }
virtual bool CanThroughable(Human* num) { return false; }
void Explosion(Bullet* bullet);
void SetDoorInfo(Building* building, int door_id_x);
bool IsDoor();

View File

@ -82,3 +82,8 @@ void RoomObstacle::RecalcSelfCollider()
#endif
}
}
bool RoomObstacle::CanThroughable(Human* num)
{
return true;
}

View File

@ -14,6 +14,7 @@ class RoomObstacle : public Obstacle
virtual void Initialize() override;
virtual void RecalcSelfCollider() override;
virtual bool IsTerminatorAirDropBox(Room* room) override { return is_terminator_airdrop_box; }
virtual bool CanThroughable(Human* num) override;
protected:
RoomObstacle();

View File

@ -102,6 +102,7 @@ message Equip
optional string param1 = 43;
optional int32 reloadtype = 46;
optional float Recoil_force = 47;
optional float missiles_time = 48;
optional string inventory_slot = 31; //
optional int32 _inventory_slot = 32; //