Fixed changeskill being unnetworked

This commit is contained in:
Boondorl 2024-04-25 18:09:53 -04:00 committed by Rachael Alexanderson
parent ca95e18742
commit f0aa0acf08
3 changed files with 9 additions and 2 deletions

View file

@ -412,7 +412,7 @@ CCMD (changeskill)
{
if (!players[consoleplayer].mo || !usergame)
{
Printf ("Use the skill command when not in a game.\n");
Printf ("Cannot change skills while not in a game.\n");
return;
}
@ -431,7 +431,8 @@ CCMD (changeskill)
}
else
{
NextSkill = skill;
Net_WriteInt8(DEM_CHANGESKILL);
Net_WriteInt32(skill);
Printf ("Skill %d will take effect on the next map.\n", skill);
}
}

View file

@ -2753,6 +2753,10 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
primaryLevel->localEventManager->NetCommand(netCmd);
}
break;
case DEM_CHANGESKILL:
NextSkill = ReadInt32(stream);
break;
default:
I_Error ("Unknown net command: %d", type);
@ -2848,6 +2852,7 @@ void Net_SkipCommand (int type, uint8_t **stream)
case DEM_INVUSE:
case DEM_FOV:
case DEM_MYFOV:
case DEM_CHANGESKILL:
skip = 4;
break;

View file

@ -164,6 +164,7 @@ enum EDemoCommand
DEM_SETINV, // 72 SetInventory
DEM_ENDSCREENJOB,
DEM_ZSC_CMD, // 74 String: Command, Word: Byte size of command
DEM_CHANGESKILL, // 75 Int: Skill
};
// The following are implemented by cht_DoCheat in m_cheat.cpp