Aaron/fixwheelchair (#8001)
* Fix OSM2ODR build * Updated fix wheelchair default value
This commit is contained in:
parent
eeb507e585
commit
f2695a17d1
|
@ -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):
|
||||||
|
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
|
@ -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)
|
||||||
|
{
|
||||||
|
}
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue