From ec481e820963496a2928cc6709f8f5817af93eaa Mon Sep 17 00:00:00 2001 From: Wanne Date: Fri, 11 Apr 2014 07:16:46 +0000 Subject: [PATCH] Allow different rules for climbing (and jumping) with backpacks (by JMich) - ja2_options.ini: MAX_BACKPACK_WEIGHT_TO_CLIMB, USE_GLOBAL_BACKPACK_SETTINGS - First setting is sBackpackWeightToClimb which is the maximum weight a backpack can weigh and still allow you to climb with. The sBackpackWeightModifier in items.xml can modify that number by either making it harder (positive number modifier) or easier (negative number modifier). If the sBackpackWeightToClimb is -1 (default) then the option is unused. Second setting is fUseGlobalBackpackSettings which if true (default) uses the same rules for all backpacks, while if false it checks for the fAllowClimbing tag in items.xml, and if that is true you can climb with said backpack. Both options can be used at the same time, so you may climb with (for example) a malice backpack that weighs less than 5kg (or 50 hg) but not climb with a radio set. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7146 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameSettings.cpp | 4 +++ GameSettings.h | 4 +++ Tactical/Item Types.h | 4 +++ Tactical/Overhead.cpp | 6 +++- Tactical/Real Time Input.cpp | 12 +++++-- Tactical/Soldier Control.cpp | 6 +++- Tactical/Turn Based Input.cpp | 60 +++++++++++++++++++++++++++++------ TacticalAI/AIUtils.cpp | 5 ++- TacticalAI/FindLocations.cpp | 5 ++- Utils/XML_Items.cpp | 17 ++++++++-- 10 files changed, 105 insertions(+), 18 deletions(-) diff --git a/GameSettings.cpp b/GameSettings.cpp index 7bde6f3c..6b7ef02c 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1343,6 +1343,10 @@ void LoadGameExternalOptions() gGameExternalOptions.fCanJumpThroughWindows = iniReader.ReadBoolean("Tactical Gameplay Settings","CAN_JUMP_THROUGH_WINDOWS", FALSE); gGameExternalOptions.fCanJumpThroughClosedWindows = iniReader.ReadBoolean("Tactical Gameplay Settings","CAN_JUMP_THROUGH_CLOSED_WINDOWS", TRUE); gGameExternalOptions.fCanClimbOnWalls = iniReader.ReadBoolean("Tactical Gameplay Settings","CAN_CLIMB_ON_WALLS", FALSE); + + //JMich.BackpackClimb + gGameExternalOptions.sBackpackWeightToClimb = iniReader.ReadInteger("Tactical Gameplay Settings", "MAX_BACKPACK_WEIGHT_TO_CLIMB", -1); + gGameExternalOptions.fUseGlobalBackpackSettings = iniReader.ReadBoolean("Tactical Gameplay Settings", "USE_GLOBAL_BACKPACK_SETTINGS", TRUE); // sevenfm gGameExternalOptions.fShowEnemyWeapon = iniReader.ReadBoolean("Tactical Gameplay Settings","SHOW_ENEMY_WEAPON", FALSE); diff --git a/GameSettings.h b/GameSettings.h index 362510f6..0f1e7ac1 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -1199,6 +1199,10 @@ typedef struct BOOLEAN fCanJumpThroughClosedWindows; BOOLEAN fCanClimbOnWalls; + //JMich.BackpackClimb + INT16 sBackpackWeightToClimb; + BOOLEAN fUseGlobalBackpackSettings; + // sevenfm: show enemy weapon above soldier in tactical BOOLEAN fShowEnemyWeapon; BOOLEAN fShowEnemyExtendedInfo; diff --git a/Tactical/Item Types.h b/Tactical/Item Types.h index ca7d971d..bf09a3d4 100644 --- a/Tactical/Item Types.h +++ b/Tactical/Item Types.h @@ -1168,6 +1168,10 @@ typedef struct // Flugente: spoting effectiveness INT16 usSpotting; + //JMich.BackpackClimb + INT16 sBackpackWeightModifier; //modifier to weight calculation to climb. + BOOLEAN fAllowClimbing; //does item allow climbing while wearing it + } INVTYPE; diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index 44b08123..1e3daae0 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -2021,7 +2021,11 @@ BOOLEAN HandleGotoNewGridNo( SOLDIERTYPE *pSoldier, BOOLEAN *pfKeepMoving, BOOLE // CHRISL: Added penalty for jumping a fence while wearing a backpack // Do we have APs? // SANDRO - changed the static values to precise calculation here - if((UsingNewInventorySystem() == true) && pSoldier->inv[BPACKPOCKPOS].exists() == true) + if ((UsingNewInventorySystem() == true) && pSoldier->inv[BPACKPOCKPOS].exists() == true + //JMich.BackpackClimb + && ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb) + && ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE))) + { sAPCost = GetAPsToJumpFence( pSoldier, TRUE ); sBPCost = GetBPsToJumpFence( pSoldier, TRUE ); diff --git a/Tactical/Real Time Input.cpp b/Tactical/Real Time Input.cpp index 514fd5c7..7f4fac52 100644 --- a/Tactical/Real Time Input.cpp +++ b/Tactical/Real Time Input.cpp @@ -2104,7 +2104,11 @@ void HandleMouseRTX1Button( UINT32 *puiNewEvent ) BOOLEAN fNearLowerLevel; INT8 bDirection; // CHRISL: Turn off manual jumping while wearing a backpack - if(UsingNewInventorySystem() == true && pjSoldier->inv[BPACKPOCKPOS].exists() == true) + if (UsingNewInventorySystem() == true && pjSoldier->inv[BPACKPOCKPOS].exists() == true + //JMich.BackpackClimb + && ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb) + && ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE))) + return; // Make sure the merc is not collapsed! @@ -2197,7 +2201,11 @@ void HandleRTJump( void ) BOOLEAN fNearLowerLevel; INT8 bDirection; // CHRISL: Turn off manual jumping while wearing a backpack - if(UsingNewInventorySystem() == true && pjSoldier->inv[BPACKPOCKPOS].exists() == true) + if (UsingNewInventorySystem() == true && pjSoldier->inv[BPACKPOCKPOS].exists() == true + //JMich.BackpackClimb + && ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb) + && ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE))) + return; // Make sure the merc is not collapsed! diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index dd3d28c1..32607fc7 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -9125,7 +9125,11 @@ void SOLDIERTYPE::BeginSoldierClimbUpRoof( void ) { //CHRISL: Disable climbing up to a roof while wearing a backpack - if((UsingNewInventorySystem() == true) && this->inv[BPACKPOCKPOS].exists() == true) { + if ((UsingNewInventorySystem() == true) && this->inv[BPACKPOCKPOS].exists() == true + //JMich.BackpackClimb + && ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)this->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[this->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb) + && ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[this->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE))) + { ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, NewInvMessage[NIV_NO_CLIMB] ); return; } diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index 48446a0d..c760f00e 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -2846,7 +2846,11 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) if ( FindWindowJumpDirection( lSoldier, lSoldier->sGridNo, lSoldier->ubDirection, &bDirection ) ) { - if((UsingNewInventorySystem() == true) && lSoldier->inv[BPACKPOCKPOS].exists() == true) + if ((UsingNewInventorySystem() == true) && lSoldier->inv[BPACKPOCKPOS].exists() == true + //JMich.BackpackClimb + && ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)lSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[lSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb) + && ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[lSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE))) + { //Moa: no jumping with backpack //sAPCost = GetAPsToJumpThroughWindows( lSoldier, TRUE ); @@ -2916,7 +2920,11 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) if ( fNearLowerLevel ) { // No climbing when wearing a backpack! - if((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true) + if ((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true + //JMich.BackpackClimb + && ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb) + && ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE))) + return; if ( EnoughPoints( pjSoldier, GetAPsToClimbRoof( pjSoldier, TRUE ), GetBPsToClimbRoof( pjSoldier, TRUE ), FALSE ) ) @@ -2927,7 +2935,11 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) if ( fNearHeigherLevel ) { // No climbing when wearing a backpack! - if((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true) + if ((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true + //JMich.BackpackClimb + && ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb) + && ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE))) + return; if ( EnoughPoints( pjSoldier, GetAPsToClimbRoof( pjSoldier, FALSE ), GetBPsToClimbRoof( pjSoldier, FALSE ), FALSE ) ) @@ -2939,7 +2951,11 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) // Jump over fence if ( FindFenceJumpDirection( pjSoldier, pjSoldier->sGridNo, pjSoldier->ubDirection, &bDirection ) ) { - if((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true) + if ((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true + //JMich.BackpackClimb + && ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb) + && ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE))) + { //Moa: no jumping whith backpack //sAPCost = GetAPsToJumpFence( pjSoldier, TRUE ); @@ -2963,7 +2979,11 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) if (gGameExternalOptions.fCanClimbOnWalls == TRUE) { // No climbing when wearing a backpack! - if((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true) + if ((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true + //JMich.BackpackClimb + && ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb) + && ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE))) + return; if ( FindWallJumpDirection( pjSoldier, pjSoldier->sGridNo, pjSoldier->ubDirection, &bDirection ) ) @@ -6991,7 +7011,11 @@ void HandleTBJump( void ) if ( fNearLowerLevel ) { // CHRISL: Turn off manual jumping while wearing a backpack - if(UsingNewInventorySystem() == true && pjSoldier->inv[BPACKPOCKPOS].exists() == true) + if (UsingNewInventorySystem() == true && pjSoldier->inv[BPACKPOCKPOS].exists() == true + //JMich.BackpackClimb + && ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb) + && ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE))) + return; if ( EnoughPoints( pjSoldier, GetAPsToClimbRoof( pjSoldier, TRUE ), GetBPsToClimbRoof( pjSoldier, TRUE ), FALSE ) ) @@ -7003,7 +7027,11 @@ void HandleTBJump( void ) if ( fNearHeigherLevel ) { // No climbing when wearing a backpack! - if((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true) + if ((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true + //JMich.BackpackClimb + && ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb) + && ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE))) + return; if ( EnoughPoints( pjSoldier, GetAPsToClimbRoof( pjSoldier, FALSE ), GetBPsToClimbRoof( pjSoldier, FALSE ), FALSE ) ) @@ -7015,7 +7043,11 @@ void HandleTBJump( void ) // Jump over fence if ( FindFenceJumpDirection( pjSoldier, pjSoldier->sGridNo, pjSoldier->ubDirection, &bDirection ) ) { - if((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true) + if ((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true + //JMich.BackpackClimb + && ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb) + && ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE))) + { sAPCost = GetAPsToJumpFence( pjSoldier, TRUE ); sBPCost = GetBPsToJumpFence( pjSoldier, TRUE ); @@ -7038,7 +7070,11 @@ void HandleTBJump( void ) if ( FindWallJumpDirection( pjSoldier, pjSoldier->sGridNo, pjSoldier->ubDirection, &bDirection ) ) { // No climbing when wearing a backpack! - if((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true) + if ((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true + //JMich.BackpackClimb + && ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb) + && ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE))) + return; if ( EnoughPoints( pjSoldier, GetAPsToJumpWall( pjSoldier, FALSE ), GetBPsToJumpWall( pjSoldier, FALSE ), FALSE ) ) @@ -7062,7 +7098,11 @@ void HandleTBJumpThroughWindow( void ){ { if ( FindWindowJumpDirection( pjSoldier, pjSoldier->sGridNo, pjSoldier->ubDirection, &bDirection ) ) { - if((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true) + if ((UsingNewInventorySystem() == true) && pjSoldier->inv[BPACKPOCKPOS].exists() == true + //JMich.BackpackClimb + && ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pjSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pjSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb) + && ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pjSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE))) + { sAPCost = GetAPsToJumpThroughWindows( pjSoldier, TRUE ); sBPCost = GetBPsToJumpThroughWindows( pjSoldier, TRUE ); diff --git a/TacticalAI/AIUtils.cpp b/TacticalAI/AIUtils.cpp index 274c6922..79377a96 100644 --- a/TacticalAI/AIUtils.cpp +++ b/TacticalAI/AIUtils.cpp @@ -579,7 +579,10 @@ BOOLEAN IsActionAffordable(SOLDIERTYPE *pSoldier) break; case AI_ACTION_JUMP_WINDOW: - if((UsingNewInventorySystem() == true) && pSoldier->inv[BPACKPOCKPOS].exists() == true) + if((UsingNewInventorySystem() == true) && pSoldier->inv[BPACKPOCKPOS].exists() == true + //JMich.BackpackClimb + && ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb ) + && ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE))) bMinPointsNeeded = GetAPsToJumpThroughWindows( pSoldier, TRUE ); else bMinPointsNeeded = GetAPsToJumpFence( pSoldier, FALSE ); diff --git a/TacticalAI/FindLocations.cpp b/TacticalAI/FindLocations.cpp index 84540747..44b44682 100644 --- a/TacticalAI/FindLocations.cpp +++ b/TacticalAI/FindLocations.cpp @@ -2886,7 +2886,10 @@ INT8 FindDirectionForClimbing( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel else if (bLevel == 1) { //CHRISL: If NewInv and wearing a backpack, don't allow climbing - if(UsingNewInventorySystem() == true && pSoldier->inv[BPACKPOCKPOS].exists() == true) + if (UsingNewInventorySystem() == true && pSoldier->inv[BPACKPOCKPOS].exists() == true + //JMich.BackpackClimb + && ((gGameExternalOptions.sBackpackWeightToClimb == -1) || (INT16)pSoldier->inv[BPACKPOCKPOS].GetWeightOfObjectInStack() + Item[pSoldier->inv[BPACKPOCKPOS].usItem].sBackpackWeightModifier > gGameExternalOptions.sBackpackWeightToClimb) + && ((gGameExternalOptions.fUseGlobalBackpackSettings == TRUE) || (Item[pSoldier->inv[BPACKPOCKPOS].usItem].fAllowClimbing == FALSE))) return DIRECTION_IRRELEVANT; if (gpWorldLevelData[ sGridNo].ubExtFlags[1] & MAPELEMENT_EXT_CLIMBPOINT) { diff --git a/Utils/XML_Items.cpp b/Utils/XML_Items.cpp index bc153f29..dbc01215 100644 --- a/Utils/XML_Items.cpp +++ b/Utils/XML_Items.cpp @@ -279,7 +279,9 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at strcmp(name, "ItemChoiceTimeSetting") == 0 || strcmp(name, "buddyitem") == 0 || strcmp(name, "SleepModifier") == 0 || - strcmp(name, "usSpotting") == 0)) + strcmp(name, "usSpotting") == 0 || + strcmp(name, "sBackpackWeightModifier") == 0 || + strcmp(name, "fAllowClimbing") == 0)) { pData->curElement = ELEMENT_PROPERTY; //DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("itemStartElementHandle: going into element, name = %s",name) ); @@ -1445,6 +1447,16 @@ itemEndElementHandle(void *userData, const XML_Char *name) // values between 0 and 100 only pData->curItem.usSpotting = min(100, max(0, (INT16) atol(pData->szCharData) ) ); } + else if (strcmp(name, "sBackpackWeightModifier") == 0) + { + pData->curElement = ELEMENT; + pData->curItem.sBackpackWeightModifier = (INT16)atol(pData->szCharData); + } + else if (strcmp(name, "fAllowClimbing") == 0) + { + pData->curElement = ELEMENT; + pData->curItem.fAllowClimbing = (BOOLEAN)atol(pData->szCharData); + } pData->maxReadDepth--; } @@ -2088,7 +2100,8 @@ BOOLEAN WriteItemStats() FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].usBuddyItem ); FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].ubSleepModifier ); FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].usSpotting ); - + FilePrintf(hFile, "\t\t%d\r\n", Item[cnt].sBackpackWeightModifier); + FilePrintf(hFile, "\t\t%d\r\n", Item[cnt].fAllowClimbing); FilePrintf(hFile,"\t\r\n"); } FilePrintf(hFile,"\r\n");