diff --git a/server/gameserver/bullet.cc b/server/gameserver/bullet.cc index d927200..85431d9 100644 --- a/server/gameserver/bullet.cc +++ b/server/gameserver/bullet.cc @@ -88,8 +88,8 @@ void Bullet::OnHit(std::vector& objects) { Obstacle* obstacle = (Obstacle*)target; if (!obstacle->dead && obstacle->meta->i->attack_type() == 1) { - obstacle->health = std::min(0.0f, obstacle->health - 10); - obstacle->dead = std::min(obstacle->health, 0.001f) <= 0.01f; + obstacle->health = std::max(0.0f, obstacle->health - 10); + obstacle->dead = obstacle->health <= 0.01f; obstacle->dead_frameno = room->frame_no; if (obstacle->dead) { obstacle->ClearColliders(); diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 3d44e6e..632c565 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -614,6 +614,7 @@ bool Human::HasLiveTeammate() void Human::Land() { a8::UnSetBitFlag(status, HS_Jump); + FindLocation(); SyncAroundPlayers(); } @@ -635,3 +636,15 @@ void Human::DoJump() &xtimer_attacher.timer_list_); } } + +void Human::FindLocation() +{ + { + std::vector objects; + int detection_flags = 0; + { + a8::SetBitFlag(detection_flags, ET_Building); + } + room->CollisionDetection(this, detection_flags, objects); + } +} diff --git a/server/gameserver/human.h b/server/gameserver/human.h index 22626e1..857371e 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -119,6 +119,7 @@ class Human : public Entity bool HasLiveTeammate(); void Land(); void DoJump(); + void FindLocation(); protected: