This commit is contained in:
aozhiwei 2024-01-17 11:57:43 +08:00
parent 2d597fc5b8
commit 3048b8a193
2 changed files with 4 additions and 5 deletions

View File

@ -1557,9 +1557,6 @@ behaviac::EBTStatus HeroAgent::ThrowItem(int slot)
bomb_dir,
fly_distance,
0);
if (owner_->IsHuman()) {
owner_->AsHuman()->stats->IncWeaponUseTimes(weapon.meta->id(), 1);
}
last_throw_item_frameno_ = owner_->room->GetFrameNo();
return behaviac::BT_SUCCESS;
}

View File

@ -2551,7 +2551,7 @@ void SyncObject::FillSMSyncPosition(cs::SMSyncPosition& sync_msg)
}
int Creature::Throw(int slot, const glm::vec3& bomb_pos, const glm::vec3& bomb_dir,
float fly_distance, int estimated_time)
float fly_distance, int estimated_time)
{
if (!IsHuman()) {
return 0;
@ -2559,11 +2559,13 @@ int Creature::Throw(int slot, const glm::vec3& bomb_pos, const glm::vec3& bomb_d
if (slot < 0 || slot >= weapons.size()) {
return 0;
}
Weapon& weapon = weapons.at(slot);
if (weapon.weapon_idx != 0 &&
weapon.meta &&
weapon.ammo > 0) {
if (IsHuman()) {
AsHuman()->stats->IncWeaponUseTimes(weapon.meta->id(), 1);
}
if (HasBuffEffect(kBET_Hide)) {
RemoveHideEffect(kShotReason);
}