Allow setting string user variables in ACS

This commit is contained in:
Jason Francis 2018-03-19 12:43:26 -04:00 committed by Christoph Oelckers
commit bd7791ad9c
3 changed files with 13 additions and 9 deletions

View file

@ -1658,7 +1658,7 @@ static void SetMapThingUserData(AActor *actor, unsigned udi)
else
{ // Set the value of the specified user variable.
void *addr = reinterpret_cast<uint8_t *>(actor) + var->Offset;
if (var->Type->isString())
if (var->Type == TypeString)
{
var->Type->InitializeValue(addr, &MapThingsUserData[udi].StringVal);
}
@ -1666,7 +1666,7 @@ static void SetMapThingUserData(AActor *actor, unsigned udi)
{
var->Type->SetValue(addr, MapThingsUserData[udi].FloatVal);
}
else if (var->Type->isIntCompatible())
else if (var->Type->isInt() || var->Type == TypeBool)
{
var->Type->SetValue(addr, MapThingsUserData[udi].IntVal);
}