Fixed not being able to set to a string indexed userdata value.

This commit is contained in:
Deukhoofd 2019-09-22 17:09:14 +02:00
parent eacdb8a593
commit de39464b33
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 6 additions and 1 deletions

View File

@ -74,6 +74,12 @@ namespace Porygon::UserData {
delete value;
}
void SetIndexValue(const Utilities::HashedString *key, const EvalValue *value) const override {
auto field = _userData->Get()->GetField(key->GetHash());
field->Set(_obj, value);
delete value;
}
[[nodiscard]] inline void* GetObjectPointer() const{
return _obj;
}
@ -82,7 +88,6 @@ namespace Porygon::UserData {
EvalValue* Cast(shared_ptr<const ScriptType> castType) const final{
return _userData->Get()->Cast(_obj, castType.get());
}
};
}