diff --git a/Strategic/LuaInitNPCs.cpp b/Strategic/LuaInitNPCs.cpp index 86fa0bdc..2e64b5aa 100644 --- a/Strategic/LuaInitNPCs.cpp +++ b/Strategic/LuaInitNPCs.cpp @@ -2475,6 +2475,7 @@ BOOLEAN LuaHandleQuestCodeOnSector( INT16 sSectorX, INT16 sSectorY, INT8 bSector //init function lua_register(L, "CheckFact", l_CheckFact); lua_register(L, "CheckForMissingHospitalSupplies", l_CheckForMissingHospitalSupplies); + lua_register(L, "CheckForKingpinsMoneyMissing", l_FunctionCheckForKingpinsMoneyMissing); IniFunction(L); IniGlobalGameSetting(L); diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index 25bddc18..31444b61 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -13499,10 +13499,13 @@ BOOLEAN OBJECTTYPE::TransformObject( SOLDIERTYPE * pSoldier, UINT8 ubStatusIndex //Madd: Common Attachment Framework - check if a given point is acceptable bool IsAttachmentPointAvailable( OBJECTTYPE * pObject, UINT8 subObject, UINT32 attachmentID ) { - if (Item[pObject->usItem].ulAvailableAttachmentPoint > 0 && (Item[attachmentID].attachment || Item[attachmentID].usItemClass & IC_GRENADE || Item[attachmentID].usItemClass & IC_BOMB)&& Item[attachmentID].ulAttachmentPoint & GetAvailableAttachmentPoint(pObject, subObject)) - return true; - else - return false; + if (pObject) + { + if (Item[pObject->usItem].ulAvailableAttachmentPoint > 0 && (Item[attachmentID].attachment || Item[attachmentID].usItemClass & IC_GRENADE || Item[attachmentID].usItemClass & IC_BOMB)&& Item[attachmentID].ulAttachmentPoint & GetAvailableAttachmentPoint(pObject, subObject)) + return true; + } + + return false; } //Madd: Common Attachment Framework - if we already know the point diff --git a/TileEngine/Exit Grids.cpp b/TileEngine/Exit Grids.cpp index be49cf3d..6078b801 100644 --- a/TileEngine/Exit Grids.cpp +++ b/TileEngine/Exit Grids.cpp @@ -325,7 +325,6 @@ INT32 FindGridNoFromSweetSpotCloseToExitGrid( SOLDIERTYPE *pSoldier, INT32 sSwee INT32 sLowestGridNo=0; INT32 leftmost; BOOLEAN fFound = FALSE; - SOLDIERTYPE soldier; INT16 ubSaveNPCAPBudget; UINT8 ubSaveNPCDistLimit; EXITGRID ExitGrid; @@ -338,12 +337,6 @@ INT32 FindGridNoFromSweetSpotCloseToExitGrid( SOLDIERTYPE *pSoldier, INT32 sSwee gubNPCAPBudget = 0; gubNPCDistLimit = ubRadius; - //create dummy soldier, and use the pathing to determine which nearby slots are - //reachable. - soldier.pathing.bLevel = 0; - soldier.bTeam = 1; - soldier.sGridNo = pSoldier->sGridNo; - // OK, Get an exit grid ( if possible ) if ( !GetExitGrid( sSweetGridNo, &ExitGrid ) ) { @@ -379,7 +372,7 @@ INT32 FindGridNoFromSweetSpotCloseToExitGrid( SOLDIERTYPE *pSoldier, INT32 sSwee //Now, find out which of these gridnos are reachable //(use the fake soldier and the pathing settings) - FindBestPath( &soldier, GRIDSIZE, 0, WALKING, COPYREACHABLE, PATH_THROUGH_PEOPLE );//dnl ch50 071009 + FindBestPath( pSoldier, GRIDSIZE, 0, WALKING, COPYREACHABLE, PATH_THROUGH_PEOPLE );//dnl ch50 071009 uiLowestRange = 999999;