This commit is contained in:
aozhiwei 2023-11-14 13:57:16 +08:00
parent 27d454857c
commit b70dc4c3ab

View File

@ -1317,9 +1317,14 @@ behaviac::EBTStatus HeroAgent::Pickup()
RoomObstacle* ob = curr_pickup_obj_.Get()->AsRoomObstacle();
owner_->AsHuman()->ObstacleInteraction(ob);
} else if (curr_pickup_obj_.Get()->IsCar()) {
if (owner_->HasBuffEffect(kBET_Driver) ||
owner_->HasBuffEffect(kBET_Passenger)) {
return behaviac::BT_FAILURE;
} else {
Car* car = curr_pickup_obj_.Get()->AsCar();
owner_->AsHuman()->DoGetOn(car->GetUniId());
}
}
return behaviac::BT_SUCCESS;
};
return StartCoroutine(co);