forked from NVIDIA/Q2RTX
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend Q2PRO protocol to allow clientNum >= 255.
When GMF_CLIENTNUM feature was introduced, it was expected that client POV number will only be set to valid client slot numbers in range [0, 255). Therefore, clientNum has been transmitted as a byte, with 255 (CLIENTNUM_NONE) reserved for a special case to indicate no current POV number (this has always been buggy, see below). However, one might want to set client POV to any entity >= 256, not just client entitites (to view the game from monster POV, for example). Thus, make clientNum strictly mean ‘number of POV entity minus 1’ and transmit it as a short in range [-1, MAX_EDICTS - 1). To accomodate older Q2PRO clients, reset clientNum to client slot number and zero out POV entity modelindex if clientNum is >= 255. clientNum == -1 is legal, and can happen e.g. when playing a MVD without dummy MVD observer spawned. -1 maps to 255 (CLIENTNUM_NONE) upon reading on older Q2PRO clients. This is buggy, as it will make entity 256 invisible, but there doesn't seem to be a proper fix. Mapping -1 to client slot number will make random _player_ entity invisible instead, which is worse. So don't change anything about -1. For newer Q2PRO clients clientNum == -1 will be transmitted as literal -1. This will map to entity 0 (world) and things will work as expected. This was (and still is) a huge mess. Fixes NVIDIA#260.
- Loading branch information
1 parent
fb6fc4e
commit a6a635b
Showing
3 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters