# HG changeset patch
# User Binary Code
# Date 1712264295 25200
#      Thu Apr 04 13:58:15 2024 -0700
# Node ID 8103adfa01ef7f14ed00a284bac64cca4437f008
# Parent  a66285f220ef157404b72ab17d35f55fd8270b75
Changed player_t::CurrentPlayerClass from a byte to an int, allowing more than 255 player classes to be used.

diff -r a66285f220ef -r 8103adfa01ef docs/zandronum-history.txt
--- a/docs/zandronum-history.txt	Fri Mar 29 23:03:39 2024 -0400
+++ b/docs/zandronum-history.txt	Thu Apr 04 13:58:15 2024 -0700
@@ -192,6 +192,7 @@
 !	- The position of the weapon sprite while swaying now only updates at 35 Hz instead of at the refresh rate. [Kaminsky]
 !	- Renamed "cl_swayspeed" to "cl_viewswayspeed", to distinguish it from the new weapon sway speeds (i.e. motion and jump). [Kaminsky]
 !	- Made the mini flag icons that appear on the HUD and scoreboard bigger and easier to see. [Kaminsky]
+!	- Changed player_t::CurrentPlayerClass from a byte to an int, allowing more than 255 player classes to be used. [Binary]
 
 
 3.1
diff -r a66285f220ef -r 8103adfa01ef protocolspec/spec.players.txt
--- a/protocolspec/spec.players.txt	Fri Mar 29 23:03:39 2024 -0400
+++ b/protocolspec/spec.players.txt	Thu Apr 04 13:58:15 2024 -0700
@@ -11,7 +11,8 @@
 	Fixed x
 	Fixed y
 	Fixed z
-	Byte playerClass
+	# [Binary] Changed Byte to UShort.
+	UShort playerClass
 
 	If (isMorphed)
 		Short morphStyle
diff -r a66285f220ef -r 8103adfa01ef src/cl_main.cpp
--- a/src/cl_main.cpp	Fri Mar 29 23:03:39 2024 -0400
+++ b/src/cl_main.cpp	Thu Apr 04 13:58:15 2024 -0700
@@ -3549,7 +3549,8 @@
 
 	// [BB] We may not filter coop inventory if the player changed the player class.
 	// Thus we need to keep track of the old class.
-	const BYTE oldPlayerClass = pPlayer->CurrentPlayerClass;
+	// [Binary] Changed BYTE to int.
+	const int oldPlayerClass = pPlayer->CurrentPlayerClass;
 
 	// Set up the player class.
 	pPlayer->CurrentPlayerClass = clamp<int>( playerClass, 0, PlayerClasses.Size() -1 );
diff -r a66285f220ef -r 8103adfa01ef src/d_player.h
--- a/src/d_player.h	Fri Mar 29 23:03:39 2024 -0400
+++ b/src/d_player.h	Thu Apr 04 13:58:15 2024 -0700
@@ -594,7 +594,7 @@
 										// is used during levels
 
 	int			inventorytics;
-	BYTE		CurrentPlayerClass;		// class # for this player instance
+	int			CurrentPlayerClass;		// class # for this player instance // [Binary] Changed BYTE to int.
 	bool		backpack;
 	
 	int			fragcount;				// [RH] Cumulative frags for this player
diff -r a66285f220ef -r 8103adfa01ef src/g_game.cpp
--- a/src/g_game.cpp	Fri Mar 29 23:03:39 2024 -0400
+++ b/src/g_game.cpp	Thu Apr 04 13:58:15 2024 -0700
@@ -2146,7 +2146,7 @@
 	int 		itemcount;
 	int 		secretcount;
 	int			chasecam;
-	BYTE		currclass;
+	int			currclass; // [Binary] Changed BYTE to int.
 	userinfo_t  userinfo;	// [RH] Save userinfo
 	// [BB]
 	//botskill_t  b_skill;	//Added by MC:
diff -r a66285f220ef -r 8103adfa01ef src/p_mobj.cpp
--- a/src/p_mobj.cpp	Fri Mar 29 23:03:39 2024 -0400
+++ b/src/p_mobj.cpp	Thu Apr 04 13:58:15 2024 -0700
@@ -5419,7 +5419,8 @@
 
 	// [BB] We may not filter coop inventory if the player changed the player class.
 	// Thus we need to keep track of the old class.
-	const BYTE oldPlayerClass = p->CurrentPlayerClass;
+	// [Binary] Changed BYTE to int.
+	const int oldPlayerClass = p->CurrentPlayerClass;
 	const bool bAllowChangingClass = (( p->userinfo.GetPlayerClassNum( ) != p->CurrentPlayerClass ) && ( p->playerstate != PST_LIVE ));
 
 	// [BB] The (p->userinfo.GetPlayerClassNum() != p->CurrentPlayerClass) check allows the player to change its class when respawning.
