From 6aee7833d0d3107cf6ce434106e2724dba78624a Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Wed, 21 Aug 2013 22:51:12 -0500 Subject: [PATCH] Use PField instead of PSymbolVariable for SetMapThingUserData() --- src/p_setup.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index de760008f5..9f1708affd 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -1686,18 +1686,18 @@ static void SetMapThingUserData(AActor *actor, unsigned udi) { FName varname = MapThingsUserData[udi].Property; int value = MapThingsUserData[udi].Value; - PSymbolVariable *var = dyn_cast(actor->GetClass()->Symbols.FindSymbol(varname, true)); + PField *var = dyn_cast(actor->GetClass()->Symbols.FindSymbol(varname, true)); udi++; - if (var == NULL || var->bUserVar || var->ValueType.Type != VAL_Int) + if (var == NULL || (var->Flags & VARF_Native) || !var->Type->IsKindOf(RUNTIME_CLASS(PBasicType))) { DPrintf("%s is not a user variable in class %s\n", varname.GetChars(), actor->GetClass()->TypeName.GetChars()); } else { // Set the value of the specified user variable. - *(int *)(reinterpret_cast(actor) + var->offset) = value; + var->Type->SetValue(reinterpret_cast(actor) + var->Offset, value); } } }