mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
Fixes (by The_Bob):
- Fixed random freeze on win8/10 - Fixed crash on mercs entering sector - Fixed crash when using cover display (del/end) - Fixed attachment popup showing incompatible attachments (crash/freeze/confusion on clicking the option) - Fixed attachment popup positioning - Fixed LBE contents corruption/deletion - Fixed access violation (out of array bounds) in interrupt code - Fixed a bunch of random old stuff - Got the project to build on VS2015 - Improved popup class handling of grayed out options - Improved performance of get item assignment check (added by Flugente) - Added Ctrl+Space bind for testing/fixing broken LBE contents git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8399 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+30
-12
@@ -4587,6 +4587,9 @@ OBJECTTYPE* FindRepairableItemInLBENODE(SOLDIERTYPE * pSoldier, OBJECTTYPE * pOb
|
||||
if(pObj->IsActiveLBE(subObject) == true)
|
||||
{
|
||||
LBENODE* pLBE = pObj->GetLBEPointer(subObject);
|
||||
|
||||
if (!pLBE) return(NULL);
|
||||
|
||||
UINT8 invsize = pLBE->inv.size();
|
||||
for(UINT8 lbePocket = 0; lbePocket < invsize; ++lbePocket)
|
||||
{
|
||||
@@ -4608,7 +4611,7 @@ OBJECTTYPE* FindRepairableItemInLBENODE(SOLDIERTYPE * pSoldier, OBJECTTYPE * pOb
|
||||
}
|
||||
}
|
||||
}
|
||||
return( 0 );
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
OBJECTTYPE* FindRepairableItemInSpecificPocket(SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, UINT8 subObject)
|
||||
@@ -4799,19 +4802,22 @@ BOOLEAN RepairObject( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOwner, OBJECTTYPE *
|
||||
}
|
||||
|
||||
//CHRISL: Now check and see if this is an LBENODE with items that need repairing
|
||||
if(UsingNewInventorySystem() == true && Item[pObj->usItem].usItemClass == IC_LBEGEAR && pObj->IsActiveLBE(ubLoop) == true)
|
||||
if (UsingNewInventorySystem() == true && Item[pObj->usItem].usItemClass == IC_LBEGEAR && pObj->IsActiveLBE(ubLoop) == true)
|
||||
{
|
||||
LBENODE* pLBE = pObj->GetLBEPointer(ubLoop);
|
||||
UINT8 invsize = pLBE->inv.size();
|
||||
for(lbeLoop = 0; lbeLoop < invsize; ++lbeLoop)
|
||||
{
|
||||
if(RepairObject(pSoldier, pOwner, &pLBE->inv[lbeLoop], pubRepairPtsLeft))
|
||||
if (pLBE) {
|
||||
|
||||
UINT8 invsize = pLBE->inv.size();
|
||||
for (lbeLoop = 0; lbeLoop < invsize; ++lbeLoop)
|
||||
{
|
||||
fSomethingWasRepaired = true;
|
||||
if ( *pubRepairPtsLeft == 0 )
|
||||
if (RepairObject(pSoldier, pOwner, &pLBE->inv[lbeLoop], pubRepairPtsLeft))
|
||||
{
|
||||
// we're out of points!
|
||||
return true;
|
||||
fSomethingWasRepaired = true;
|
||||
if (*pubRepairPtsLeft == 0)
|
||||
{
|
||||
// we're out of points!
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17082,7 +17088,14 @@ void ReEvaluateEveryonesNothingToDo()
|
||||
INT32 iCounter = 0;
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
BOOLEAN fNothingToDo;
|
||||
|
||||
|
||||
UINT32 numberOfMovableItemsCache[MAXIMUM_VALID_X_COORDINATE][MAXIMUM_VALID_Y_COORDINATE];
|
||||
for (int i = 0; i < MAXIMUM_VALID_X_COORDINATE; i++) {
|
||||
for (int j = 0; j < MAXIMUM_VALID_Y_COORDINATE; j++) {
|
||||
numberOfMovableItemsCache[i][j] = INT_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
for( iCounter = 0; iCounter <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++iCounter )
|
||||
{
|
||||
pSoldier = &Menptr[ iCounter ];
|
||||
@@ -17168,7 +17181,12 @@ void ReEvaluateEveryonesNothingToDo()
|
||||
INT16 targetX = SECTORX( pSoldier->usItemMoveSectorID );
|
||||
INT16 targetY = SECTORY( pSoldier->usItemMoveSectorID );
|
||||
|
||||
fNothingToDo = (GetNumberOfMovableItems( targetX, targetY, 0 ) == 0);
|
||||
if (numberOfMovableItemsCache[targetX][targetY] == INT_MAX)
|
||||
{
|
||||
numberOfMovableItemsCache[targetX][targetY] = GetNumberOfMovableItems(targetX, targetY, 0);
|
||||
}
|
||||
|
||||
fNothingToDo = (numberOfMovableItemsCache[targetX][targetY] == 0);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user