mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 23:32:04 +00:00
Use PField instead of PSymbolVariable for SetMapThingUserData()
This commit is contained in:
parent
5aff8156ba
commit
6aee7833d0
1 changed files with 3 additions and 3 deletions
|
@ -1686,18 +1686,18 @@ static void SetMapThingUserData(AActor *actor, unsigned udi)
|
||||||
{
|
{
|
||||||
FName varname = MapThingsUserData[udi].Property;
|
FName varname = MapThingsUserData[udi].Property;
|
||||||
int value = MapThingsUserData[udi].Value;
|
int value = MapThingsUserData[udi].Value;
|
||||||
PSymbolVariable *var = dyn_cast<PSymbolVariable>(actor->GetClass()->Symbols.FindSymbol(varname, true));
|
PField *var = dyn_cast<PField>(actor->GetClass()->Symbols.FindSymbol(varname, true));
|
||||||
|
|
||||||
udi++;
|
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(),
|
DPrintf("%s is not a user variable in class %s\n", varname.GetChars(),
|
||||||
actor->GetClass()->TypeName.GetChars());
|
actor->GetClass()->TypeName.GetChars());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Set the value of the specified user variable.
|
{ // Set the value of the specified user variable.
|
||||||
*(int *)(reinterpret_cast<BYTE *>(actor) + var->offset) = value;
|
var->Type->SetValue(reinterpret_cast<BYTE *>(actor) + var->Offset, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue