Skip to content

Commit

Permalink
Fixed changeskill being unnetworked
Browse files Browse the repository at this point in the history
  • Loading branch information
Boondorl authored and coelckers committed Apr 27, 2024
1 parent 3f07d4e commit 6040416
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/console/c_cmds.cpp
Expand Up @@ -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;
}

Expand All @@ -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);
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/d_net.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions src/d_protocol.h
Expand Up @@ -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
Expand Down

0 comments on commit 6040416

Please sign in to comment.