🐛 fix target particle_threshold & particle_drop_count type issue

This commit is contained in:
Lei Shi 2023-12-15 03:34:43 +01:00 committed by GitHub
parent a876033325
commit cda7d5d814
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -281,9 +281,9 @@ class GCSimConverter:
elif key == "radius":
target.radius = float(value)
elif key == "particle_threshold":
target.particle_threshold = int(value)
target.particle_threshold = float(value)
elif key == "particle_drop_count":
target.particle_drop_count = int(value)
target.particle_drop_count = float(value)
elif key in ("pyro", "hydro", "dendro", "electro", "anemo", "cryo", "geo", "physical"):
target.others[key] = float(value)
else:

View File

@ -168,8 +168,8 @@ class GCSimTarget(BaseModel):
radius: Optional[float] = None
hp: Optional[int] = None
amount: Optional[int] = None
particle_threshold: Optional[int] = None
particle_drop_count: Optional[int] = None
particle_threshold: Optional[float] = None
particle_drop_count: Optional[float] = None
others: Dict[str, Any] = {}
def __str__(self) -> str: