- scriptified the remains of APowerup.

- ensure that actor defaults contain a valid virtual table and class pointer so that they can actually use virtual and class-dependent method functions. This is needed for retrieving script variables from them.
This commit is contained in:
Christoph Oelckers 2017-01-18 10:33:03 +01:00
commit 534b2ebbfb
15 changed files with 65 additions and 172 deletions

View file

@ -1928,7 +1928,7 @@ static int PatchMisc (int dummy)
}
else if (a > 0)
{
static_cast<APowerup *>(GetDefaultByName (types[i]))->BlendColor = PalEntry(
GetDefaultByName (types[i])->ColorVar(NAME_BlendColor) = PalEntry(
BYTE(clamp(a,0.f,1.f)*255.f),
clamp(r,0,255),
clamp(g,0,255),
@ -1936,7 +1936,7 @@ static int PatchMisc (int dummy)
}
else
{
static_cast<APowerup *>(GetDefaultByName (types[i]))->BlendColor = 0;
GetDefaultByName (types[i])->ColorVar(NAME_BlendColor) = 0;
}
}
}