1
This commit is contained in:
parent
2bd1ebebdb
commit
b5840bd56e
@ -1538,8 +1538,7 @@ void Creature::Shot(a8::Vec2& target_dir, bool& shot_ok, float fly_distance)
|
||||
}
|
||||
|
||||
if (HasBuffEffect(kBET_Jump) ||
|
||||
HasBuffEffect(kBET_Fly) ||
|
||||
HasBuffEffect(kBET_Sprint)) {
|
||||
HasBuffEffect(kBET_Fly)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -558,6 +558,7 @@ RoomObstacle* HeroAI::FindObstacleTarget()
|
||||
|
||||
for (auto& pair : myself->room->mine_objects) {
|
||||
if (pair.second.Get() &&
|
||||
!pair.second.Get()->sweep_lock &&
|
||||
!pair.second.Get()->IsDead(myself->room) &&
|
||||
(pair.second.Get()->meta->sweep_tags & ai_meta->bits_param2) != 0) {
|
||||
if (pair.second.Get()->GetTeamId(myself->room) == myself->master.Get()->team_id) {
|
||||
@ -576,6 +577,19 @@ RoomObstacle* HeroAI::FindObstacleTarget()
|
||||
if (target && target->GetPos().Distance(myself->GetPos()) > ai_meta->int_param1) {
|
||||
target = nullptr;
|
||||
}
|
||||
if (target) {
|
||||
target->sweep_lock = true;
|
||||
myself->room->xtimer.AddDeadLineTimerAndAttach
|
||||
(
|
||||
SERVER_FRAME_RATE * 2,
|
||||
a8::XParams(),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
RoomObstacle* obstacle = (RoomObstacle*)param.sender.GetUserData();
|
||||
obstacle->sweep_lock = false;
|
||||
},
|
||||
&target->xtimer_attacher.timer_list_);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@ class RoomObstacle : public Obstacle
|
||||
CreatureWeakPtr master;
|
||||
int real_object_uniid = 0;
|
||||
std::shared_ptr<Ability> context_ability;
|
||||
bool sweep_lock = false;
|
||||
|
||||
virtual ~RoomObstacle() override;
|
||||
virtual void Initialize() override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user