From de39464b33bfdcf47dabe54738db1b3fde16442d Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 22 Sep 2019 17:09:14 +0200 Subject: [PATCH] Fixed not being able to set to a string indexed userdata value. --- src/UserData/UserDataValue.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/UserData/UserDataValue.hpp b/src/UserData/UserDataValue.hpp index af2c386..8e06d61 100644 --- a/src/UserData/UserDataValue.hpp +++ b/src/UserData/UserDataValue.hpp @@ -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 castType) const final{ return _userData->Get()->Cast(_obj, castType.get()); } - }; }