Aaron/fixwheelchair (#8001)

* Fix OSM2ODR build

* Updated fix wheelchair default value
This commit is contained in:
Blyron 2024-07-31 13:10:11 +02:00 committed by GitHub
parent eeb507e585
commit f2695a17d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 2 deletions

View File

@ -279,8 +279,11 @@ def main():
for spawn_point in spawn_points: for spawn_point in spawn_points:
walker_bp = random.choice(blueprintsWalkers) walker_bp = random.choice(blueprintsWalkers)
# set as not invincible # set as not invincible
probability = random.randint(0,100 + 1);
if walker_bp.has_attribute('is_invincible'): if walker_bp.has_attribute('is_invincible'):
walker_bp.set_attribute('is_invincible', 'false') walker_bp.set_attribute('is_invincible', 'false')
if walker_bp.has_attribute('can_use_wheelchair') and probability < 11:
walker_bp.set_attribute('use_wheelchair', 'true')
# set the max speed # set the max speed
if walker_bp.has_attribute('speed'): if walker_bp.has_attribute('speed'):
if (random.random() > percentagePedestriansRunning): if (random.random() > percentagePedestriansRunning):

View File

@ -1595,7 +1595,7 @@ void UActorBlueprintFunctionLibrary::MakePedestrianDefinition(
Definition.Attributes.Emplace(FActorAttribute{ Definition.Attributes.Emplace(FActorAttribute{
TEXT("can_use_wheel_chair"), TEXT("can_use_wheelchair"),
EActorAttributeType::Bool, EActorAttributeType::Bool,
Parameters.bCanUseWheelChair ? TEXT("true") : TEXT("false") }); Parameters.bCanUseWheelChair ? TEXT("true") : TEXT("false") });
@ -1626,7 +1626,7 @@ void UActorBlueprintFunctionLibrary::MakePedestrianDefinition(
WheelChairVariation.Type = EActorAttributeType::Bool; WheelChairVariation.Type = EActorAttributeType::Bool;
if(bCanUseWheelChair) if(bCanUseWheelChair)
{ {
WheelChairVariation.RecommendedValues = { TEXT("true"), TEXT("false") }; WheelChairVariation.RecommendedValues = { TEXT("false"), TEXT("true") };
} }
else else
{ {

View File

@ -5,3 +5,9 @@
// For a copy, see <https://opensource.org/licenses/MIT>. // For a copy, see <https://opensource.org/licenses/MIT>.
#include "WalkerBase.h" #include "WalkerBase.h"
AWalkerBase::AWalkerBase(const FObjectInitializer &ObjectInitializer)
: Super(ObjectInitializer)
{
}

View File

@ -16,6 +16,7 @@ class CARLA_API AWalkerBase : public ACharacter
GENERATED_BODY() GENERATED_BODY()
AWalkerBase(const FObjectInitializer &ObjectInitializer);
public: public:
UPROPERTY(Category="Walker Base", BlueprintReadWrite, EditAnywhere) UPROPERTY(Category="Walker Base", BlueprintReadWrite, EditAnywhere)