- made the Skins array scripting friendly and exported it.

This commit is contained in:
Christoph Oelckers 2017-02-17 21:51:23 +01:00
commit 498da825a5
17 changed files with 136 additions and 118 deletions

View file

@ -522,7 +522,7 @@ void AActor::PostSerialize()
!(flags4 & MF4_NOSKIN) &&
state->sprite == GetDefaultByType(player->cls)->SpawnState->sprite)
{ // Give player back the skin
sprite = skins[player->userinfo.GetSkin()].sprite;
sprite = Skins[player->userinfo.GetSkin()].sprite;
}
if (Speed == 0)
{
@ -666,9 +666,9 @@ bool AActor::SetState (FState *newstate, bool nofunction)
// for Dehacked, I would move sprite changing out of the states
// altogether, since actors rarely change their sprites after
// spawning.
if (player != NULL && skins != NULL)
if (player != NULL && Skins.Size() > 0)
{
sprite = skins[player->userinfo.GetSkin()].sprite;
sprite = Skins[player->userinfo.GetSkin()].sprite;
}
else if (newsprite != prevsprite)
{
@ -5398,7 +5398,7 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
}
// [GRB] Reset skin
p->userinfo.SkinNumChanged(R_FindSkin (skins[p->userinfo.GetSkin()].name, p->CurrentPlayerClass));
p->userinfo.SkinNumChanged(R_FindSkin (Skins[p->userinfo.GetSkin()].Name, p->CurrentPlayerClass));
if (!(mobj->flags2 & MF2_DONTTRANSLATE))
{
@ -5416,7 +5416,7 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
// [RH] Set player sprite based on skin
if (!(mobj->flags4 & MF4_NOSKIN))
{
mobj->sprite = skins[p->userinfo.GetSkin()].sprite;
mobj->sprite = Skins[p->userinfo.GetSkin()].sprite;
}
p->DesiredFOV = p->FOV = 90.f;