This commit is contained in:
aozhiwei 2023-11-14 14:04:23 +08:00
parent 0a0f35c9e3
commit ccc328773e

View File

@ -1265,7 +1265,7 @@ int HeroAgent::SearchPickupObj()
bool HeroAgent::PickupObjIsValid() bool HeroAgent::PickupObjIsValid()
{ {
if (curr_pickup_obj_.Get()) { if (curr_pickup_obj_.Get() && owner_->IsHuman()) {
if (curr_pickup_obj_.Get()->IsLoot()) { if (curr_pickup_obj_.Get()->IsLoot()) {
Loot* loot = curr_pickup_obj_.Get()->AsLoot(); Loot* loot = curr_pickup_obj_.Get()->AsLoot();
return !loot->pickuped; return !loot->pickuped;
@ -1277,6 +1277,9 @@ bool HeroAgent::PickupObjIsValid()
return false; return false;
} else { } else {
Car* car = curr_pickup_obj_.Get()->AsCar(); Car* car = curr_pickup_obj_.Get()->AsCar();
if (car->CanOn(owner_->AsHuman())) {
return true;
}
} }
} }
} }