- took several methods out of the native PlayerPawn implementation, either by scriptification or moving them to other places.

This commit is contained in:
Christoph Oelckers 2019-01-03 13:58:53 +01:00
commit 2258a71c36
18 changed files with 203 additions and 235 deletions

View file

@ -2279,7 +2279,7 @@ explode:
// Don't affect main player when voodoo dolls stop:
if (player && player->mo == mo && !(player->cheats & CF_PREDICTING))
{
player->mo->PlayIdle ();
PlayIdle (player->mo);
}
mo->Vel.X = mo->Vel.Y = 0;
@ -5077,7 +5077,11 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
if (deathmatch)
{ // Give all cards in death match mode.
p->mo->GiveDeathmatchInventory ();
IFVIRTUALPTR(p->mo, APlayerPawn, GiveDeathmatchInventory)
{
VMValue params[1] = { p->mo };
VMCall(func, params, 1, nullptr, 0);
}
}
else if ((multiplayer || (level.flags2 & LEVEL2_ALLOWRESPAWN) || sv_singleplayerrespawn ||
!!G_SkillProperty(SKILLP_PlayerRespawn)) && state == PST_REBORN && oldactor != NULL)
@ -7072,6 +7076,18 @@ int AActor::SpawnHealth() const
}
}
int AActor::GetMaxHealth(bool withupgrades) const
{
int ret = 100;
IFVIRTUAL(AActor, GetMaxHealth)
{
VMValue param[] = { const_cast<AActor*>(this), withupgrades };
VMReturn r(&ret);
VMCall(func, param, 2, &r, 1);
}
return ret;
}
FState *AActor::GetRaiseState()
{
if (!(flags & MF_CORPSE))