mirror of
https://github.com/lune-org/lune.git
synced 2024-12-12 13:00:37 +00:00
Fix integer attributes
This commit is contained in:
parent
4cb260c7dd
commit
7c9a1bef86
2 changed files with 7 additions and 0 deletions
|
@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
### Fixed
|
||||
|
||||
- Fixed instances with attributes not saving if they container integer attributes
|
||||
- Fixed attributes not being set properly if the instance has an empty attributes property
|
||||
- Fixed error messages for reading & writing roblox files not containing the full error message
|
||||
- Fixed crash when trying to access an instance reference property that points to a destroyed instance
|
||||
|
|
|
@ -516,6 +516,12 @@ impl Instance {
|
|||
let inst = dom
|
||||
.get_by_ref_mut(self.dom_ref)
|
||||
.expect("Failed to find instance in document");
|
||||
// NOTE: Attributes do not support integers, only floats
|
||||
let value = match value {
|
||||
DomValue::Int32(i) => DomValue::Float32(i as f32),
|
||||
DomValue::Int64(i) => DomValue::Float64(i as f64),
|
||||
value => value,
|
||||
};
|
||||
if let Some(DomValue::Attributes(attributes)) =
|
||||
inst.properties.get_mut(PROPERTY_NAME_ATTRIBUTES)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue