mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-30 08:57:00 +02:00
e407d4e547
Before the change campaign bonus selection screen had inconsistent overflow behaviour for difficulty selection: ``` 0 1 2 3 4 | available buttons: '-' to decrease ^ | '+' to increase ``` Before the change: 1. If we click '+' 5 times we will end up on difficulty=4 (ok, saturated). 2. If we click '-' 5 times we will end up on difficulty=1 (unexpected, wrap around). After the change: 1. If we click '+' 5 times we will end up on difficulty=4 (saturated). 2. If we click '-' 5 times we will end up on difficulty=0 (saturated). The inconsistency happens because `difficulty` variable has `ui8` type and server uses `difficulty = vstd::abetween(difficulty, 0, 4)` to implement the saturation. For large positive values saturation works as expected: vstd::abetween(difficulty=5, 0, 4) -> 4 For small values it does not: vstd::abetween(difficulty=-1, 0, 4) -> 4 The change makes client to avoid using negative values. |
||
---|---|---|
.. | ||
battle | ||
gui | ||
icons | ||
lobby | ||
mainmenu | ||
widgets | ||
windows | ||
CBitmapHandler.cpp | ||
CBitmapHandler.h | ||
CGameInfo.cpp | ||
CGameInfo.h | ||
Client.cpp | ||
Client.h | ||
CMakeLists.txt | ||
CMessage.cpp | ||
CMessage.h | ||
CMT.cpp | ||
CMT.h | ||
CMusicHandler.cpp | ||
CMusicHandler.h | ||
CPlayerInterface.cpp | ||
CPlayerInterface.h | ||
CreatureCostBox.cpp | ||
CreatureCostBox.h | ||
CServerHandler.cpp | ||
CServerHandler.h | ||
CVideoHandler.cpp | ||
CVideoHandler.h | ||
DPIaware.manifest | ||
Graphics.cpp | ||
Graphics.h | ||
mapHandler.cpp | ||
mapHandler.h | ||
NetPacksClient.cpp | ||
NetPacksLobbyClient.cpp | ||
resource.h | ||
SDLMain.h | ||
SDLMain.m | ||
SDLRWwrapper.cpp | ||
SDLRWwrapper.h | ||
StdInc.cpp | ||
StdInc.h | ||
VCMI_client.cbp | ||
VCMI_client.rc | ||
VCMI_client.vcxproj | ||
VCMI_client.vcxproj.filters | ||
vcmi.ico |