diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index f8aed6f..86e5f87 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -4291,12 +4291,74 @@ void Human::CheckSpecObject() std::set colliders; room->map_service->GetSpecColliders(spec_flags, room, GetPos().x, GetPos().y, colliders); + bool in_grass = false; + bool in_water = false; + bool in_ice = false; for (const ColliderComponent* collider : colliders) { switch (collider->owner->GetEntityType()) { - case ET_Loot: + case ET_Obstacle: + case ET_Building: break; default: break; } } + + if (in_grass) { + if (!HasBuffEffect(kBET_InGrass)) { + OnEnterGrass(); + } + } else { + if (HasBuffEffect(kBET_InGrass)) { + OnLeaveGrass(); + } + } + if (in_water) { + if (!HasBuffEffect(kBET_InWater)) { + OnEnterWater(); + } + } else { + if (HasBuffEffect(kBET_InWater)) { + OnLeaveWater(); + } + } + if (in_ice) { + if (!HasBuffEffect(kBET_InIce)) { + OnEnterIce(); + } + } else { + if (HasBuffEffect(kBET_InIce)) { + OnLeaveIce(); + } + } +} + +void Human::OnEnterGrass() +{ + +} + +void Human::OnLeaveGrass() +{ + +} + +void Human::OnEnterWater() +{ + +} + +void Human::OnLeaveWater() +{ + +} + +void Human::OnEnterIce() +{ + +} + +void Human::OnLeaveIce() +{ + } diff --git a/server/gameserver/human.h b/server/gameserver/human.h index a693c86..e6452b3 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -356,6 +356,12 @@ private: void DoGetOnWithLoot(Loot* loot_entity); void DoGetOnWithCar(Car* car); void CheckSpecObject(); + void OnEnterGrass(); + void OnLeaveGrass(); + void OnEnterWater(); + void OnLeaveWater(); + void OnEnterIce(); + void OnLeaveIce(); protected: int level_ = 0;