Added co-op option to remember last used weapon when respawning
This commit is contained in:
parent
3e939b0ec1
commit
29a2ca0b13
5 changed files with 19 additions and 3 deletions
|
|
@ -5508,6 +5508,7 @@ AActor *FLevelLocals::SpawnPlayer (FPlayerStart *mthing, int playernum, int flag
|
|||
p->mo = mobj;
|
||||
mobj->player = p;
|
||||
state = p->playerstate;
|
||||
const auto heldWeap = state == PST_REBORN && (dmflags3 & DF3_REMEMBER_LAST_WEAP) ? p->ReadyWeapon : nullptr;
|
||||
if (state == PST_REBORN || state == PST_ENTER)
|
||||
{
|
||||
PlayerReborn (playernum);
|
||||
|
|
@ -5608,7 +5609,7 @@ AActor *FLevelLocals::SpawnPlayer (FPlayerStart *mthing, int playernum, int flag
|
|||
{ // Special inventory handling for respawning in coop
|
||||
IFVM(PlayerPawn, FilterCoopRespawnInventory)
|
||||
{
|
||||
VMValue params[] = { p->mo, oldactor };
|
||||
VMValue params[] = { p->mo, oldactor, ((heldWeap == nullptr || (heldWeap->ObjectFlags & OF_EuthanizeMe)) ? nullptr : heldWeap) };
|
||||
VMCall(func, params, 2, nullptr, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue