Fixed bug where asset properties on new instances are created with the wrong length
This commit is contained in:
parent
43a3558383
commit
f9f6d1f963
|
@ -94,6 +94,12 @@ bool IProperty::MatchesDefault()
|
|||
else return pkValue->Matches(pkDefault);
|
||||
}
|
||||
|
||||
// ************ TAssetProperty ************
|
||||
TAssetProperty::TAssetProperty(IPropertyTemplate *pTemp, CScriptObject *pInstance, CPropertyStruct *pParent)
|
||||
: TTypedProperty(pTemp, pInstance, pParent, CAssetID::InvalidID( pTemp->Game() ))
|
||||
{
|
||||
}
|
||||
|
||||
// ************ CPropertyStruct ************
|
||||
void CPropertyStruct::Copy(const IProperty *pkProp)
|
||||
{
|
||||
|
|
|
@ -150,7 +150,10 @@ public:
|
|||
class TAssetProperty : public TTypedProperty<CAssetID, eAssetProperty, CAssetValue>
|
||||
{
|
||||
public:
|
||||
IMPLEMENT_PROPERTY_CTORS(TAssetProperty, CAssetID)
|
||||
TAssetProperty(IPropertyTemplate *pTemp, CScriptObject *pInstance, CPropertyStruct *pParent); // Can't be in the header because needs to check the template to set the correct ID length
|
||||
TAssetProperty(IPropertyTemplate *pTemp, CScriptObject *pInstance, CPropertyStruct *pParent, CAssetID v)
|
||||
: TTypedProperty(pTemp, pInstance, pParent, v) {}
|
||||
|
||||
IMPLEMENT_PROPERTY_CLONE(TAssetProperty)
|
||||
virtual bool MatchesDefault() { return !Get().IsValid(); }
|
||||
virtual bool ShouldCook() { return true; }
|
||||
|
|
Loading…
Reference in New Issue