Skip to content

Commit 6040416

Browse files
Boondorlcoelckers
authored andcommitted
Fixed changeskill being unnetworked
1 parent 3f07d4e commit 6040416

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/console/c_cmds.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ CCMD (changeskill)
412412
{
413413
if (!players[consoleplayer].mo || !usergame)
414414
{
415-
Printf ("Use the skill command when not in a game.\n");
415+
Printf ("Cannot change skills while not in a game.\n");
416416
return;
417417
}
418418

@@ -431,7 +431,8 @@ CCMD (changeskill)
431431
}
432432
else
433433
{
434-
NextSkill = skill;
434+
Net_WriteInt8(DEM_CHANGESKILL);
435+
Net_WriteInt32(skill);
435436
Printf ("Skill %d will take effect on the next map.\n", skill);
436437
}
437438
}

src/d_net.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2753,6 +2753,10 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
27532753
primaryLevel->localEventManager->NetCommand(netCmd);
27542754
}
27552755
break;
2756+
2757+
case DEM_CHANGESKILL:
2758+
NextSkill = ReadInt32(stream);
2759+
break;
27562760

27572761
default:
27582762
I_Error ("Unknown net command: %d", type);
@@ -2848,6 +2852,7 @@ void Net_SkipCommand (int type, uint8_t **stream)
28482852
case DEM_INVUSE:
28492853
case DEM_FOV:
28502854
case DEM_MYFOV:
2855+
case DEM_CHANGESKILL:
28512856
skip = 4;
28522857
break;
28532858

src/d_protocol.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ enum EDemoCommand
164164
DEM_SETINV, // 72 SetInventory
165165
DEM_ENDSCREENJOB,
166166
DEM_ZSC_CMD, // 74 String: Command, Word: Byte size of command
167+
DEM_CHANGESKILL, // 75 Int: Skill
167168
};
168169

169170
// The following are implemented by cht_DoCheat in m_cheat.cpp

0 commit comments

Comments
 (0)