- bugfix mp: If server sets ALLOW_CUSTOM_NIV = 0 and clients select another interface than the server, the following problems occured:

* crash if clients opens the inventory
* from merc item layouts if you hire a merc
* if client plays in 640x480 res and server selects NIV a crash occured

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2181 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2008-05-18 18:36:03 +00:00
parent eedb409e48
commit c5c317849c
+30 -1
View File
@@ -113,6 +113,7 @@ unsigned char packetIdentifier;
#include "laptop.h"
#include "test_space.h"
#include "interface panels.h"
@@ -1895,7 +1896,35 @@ void recieveSETTINGS (RPCParameters *rpcParameters) //recive settings from serve
WEAPON_READIED_BONUS=cl_lan->WEAPON_READIED_BONUS;
ALLOW_CUSTOM_NIV=cl_lan->ALLOW_CUSTOM_NIV;
if(ALLOW_CUSTOM_NIV==0)gGameOptions.ubInventorySystem=cl_lan->sofNewInv;
if(ALLOW_CUSTOM_NIV==0)
{
// WANNE - MP: If the clients has selected another inventory than the server had choosen.
if (gGameOptions.ubInventorySystem != cl_lan->sofNewInv)
{
gGameOptions.ubInventorySystem=cl_lan->sofNewInv;
// WANNE - MP: We have to re-initialize the correct interface
if((UsingNewInventorySystem() == true) && IsNIVModeValid(true))
{
InitNewInventorySystem();
InitializeSMPanelCoordsNew();
InitializeInvPanelCoordsNew();
}
else
{
gGameOptions.ubInventorySystem = 0;
InitOldInventorySystem();
InitializeSMPanelCoordsOld();
InitializeInvPanelCoordsOld();
}
// WANNE - MP: We also have to reinitialize the merc profiles because
// they depend on the inventory!
LoadMercProfiles();
}
}
ScreenMsg( FONT_LTGREEN, MSG_CHAT, MPClientMessage[26],cl_lan->client_num,szDefault,cl_lan->cl_edge,cl_lan->team );