This commit is contained in:
aozhiwei 2023-11-17 17:55:47 +08:00
parent 86a1d5f2d6
commit c9a56f73f5
2 changed files with 5 additions and 0 deletions

View File

@ -1466,6 +1466,9 @@ bool HeroAgent::CanThrowItem(int slot)
if (owner_->IsCar()) {
return false;
}
if (owner_->room->GetFrameNo() - last_throw_item_frameno_ < SERVER_FRAME_RATE * 5) {
return false;
}
if (owner_->HasBuffEffect(kBET_Jump) ||
owner_->HasBuffEffect(kBET_Fly)) {
return false;
@ -1550,6 +1553,7 @@ behaviac::EBTStatus HeroAgent::ThrowItem(int slot)
bomb_dir,
fly_distance,
0);
last_throw_item_frameno_ = owner_->room->GetFrameNo();
return behaviac::BT_SUCCESS;
}
}

View File

@ -176,5 +176,6 @@ private:
int bullet_angle_offset_min_ = 0;
int bullet_angle_offset_max_ = 0;
long long last_try_search_enemy_frameno_ = 0;
long long last_throw_item_frameno_ = 0;
std::map<int, int> abandon_pickup_hash_;
};