When attempting to add a chat message which is all whitespace the split_str()
function will produce no lines. The strcpy() that follows will then crash
due to an attempt to copy a nullptr.
* convert multi team chat to use a struct/list setup
* use the correct array size define
* cleanup local vars & Asserts
* address feedback
* remove uncessary if
Multiplayer screens such as PXO lobby, chat boxes, and multi-game setup screens had hard coded values for the number of lines to display. These would only work correctly with the default .vf font01 from retail. If a mod or user used a TTF or other .vf font than text would spill over. This PR makes these values take into the account the font used.
Tested and works as expected with TTF fonts and the retail fonts. Marking as draft to see what others think.
* Added a byte limit for line length in split function
* Fix call error
* Ádd missing limits import
* Change hardcoded values into defines
* Cleanup default argument
This adds a new class which allows to create type safe resource handle
types. At the moment, the engine uses ints pretty much everywhere for
providing handles to resources created by the specific subsystems. Since
all ints are the same to the C/C++ typesystem it is perfectly legal to
pass a sound handle to the graphics API as a buffer handle which will
obviously cause issues.
This adds a new type called "ID" which is a wrapper class for a generic
handle but with added type safety. An instance of this class cannot be
passed to a function expecting another type of handle which provided
compile-time type safety for these APIs.
As an initial test I converted the game sound handles to this new type.
I already found a bug in the mainhall system thanks to this new type.
The mainhall used the game sound handles as sound instance handles which
probably meant that that specific code never really worked right. I
removed the code since there was no better alternative for fixing it.
make sure NO_NETWORK builds are as friendly on Windows as it is on Linux/OSX
revert a timeout in Client.h back to the original value before Linux merge