mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
fix: The first three boxing fights could never be completed if no boxers were available (direct result of a change in r7263) because Darren's quote requires at least one boxer.
If the player killed all boxers during these fights the check would fail. A new externalized parameter "KINGPIN_RING_TILE" for Kingpins location at the ring was implemented. This is used to check if Kingpin is watching these first three fights. If so it will override the BoxersAvailable check. fix: AI could be gathering around an empty player vehicle. Disturbance check should from now on ignore that. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7737 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -2664,6 +2664,7 @@ void LoadModSettings(){
|
||||
gModSettings.ubKingpinHouseSectorZ = iniReader.ReadInteger("San Mona", "KINGPIN_HOUSE_SECTOR_Z", 0);
|
||||
gModSettings.usKingpinRoomRangeStart = iniReader.ReadInteger("San Mona", "FIRST_ROOM_IN_KINGPIN_HOUSE", 30);
|
||||
gModSettings.usKingpinRoomRangeEnd = iniReader.ReadInteger("San Mona", "LAST_ROOM_IN_KINGPIN_HOUSE", 39);
|
||||
gModSettings.iKingpinRingTile = iniReader.ReadInteger("San Mona", "KINGPIN_RING_TILE", 10763);
|
||||
|
||||
gModSettings.ubKingpinMoneySectorX = iniReader.ReadInteger("San Mona", "KINGPIN_MONEY_SECTOR_X", 5);
|
||||
gModSettings.ubKingpinMoneySectorY = iniReader.ReadInteger("San Mona", "KINGPIN_MONEY_SECTOR_Y", 4);
|
||||
|
||||
@@ -2065,6 +2065,7 @@ typedef struct
|
||||
UINT8 ubKingpinHouseSectorZ;
|
||||
UINT16 usKingpinRoomRangeStart;
|
||||
UINT16 usKingpinRoomRangeEnd;
|
||||
INT32 iKingpinRingTile;
|
||||
|
||||
//Kingpin Private Stash
|
||||
UINT8 ubKingpinMoneySectorX;
|
||||
|
||||
@@ -1135,7 +1135,7 @@ BOOLEAN CheckFact( UINT16 usFact, UINT8 ubProfileID )
|
||||
break;
|
||||
|
||||
case FACT_KINGPIN_NOT_IN_OFFICE:
|
||||
gubFact[usFact] = !( gWorldSectorX == 5 && gWorldSectorY == MAP_ROW_D && NPCInRoomRange( KINGPIN, 30, 39 ) );
|
||||
gubFact[usFact] = !( gWorldSectorX == gModSettings.ubKingpinHouseSectorX && gWorldSectorY == gModSettings.ubKingpinHouseSectorY && NPCInRoomRange( KINGPIN, gModSettings.usKingpinRoomRangeStart, gModSettings.usKingpinRoomRangeEnd ) );
|
||||
// 30 to 39
|
||||
break;
|
||||
|
||||
@@ -1145,7 +1145,14 @@ BOOLEAN CheckFact( UINT16 usFact, UINT8 ubProfileID )
|
||||
|
||||
case FACT_NO_CLUB_FIGHTING_ALLOWED:
|
||||
// anv: added !BoxersAvailable, otherwise van Haussen would offer fight even when all boxers are dead
|
||||
gubFact[usFact] = ( gubQuest[ QUEST_KINGPIN_MONEY ] == QUESTINPROGRESS || gfBoxersResting || !BoxersAvailable() );// plus other conditions
|
||||
// silversurfer: additional fix - the check below failed when we killed all boxers because BoxersAvailable() returns 0 in this case.
|
||||
// Added additional check for Kingpins location so that the three initial fights can be completed. As soon as Kingpin is gone the original check will apply again.
|
||||
SOLDIERTYPE * pKingpin;
|
||||
pKingpin = FindSoldierByProfileID( KINGPIN, FALSE );
|
||||
if ( pKingpin )
|
||||
gubFact[usFact] = ( gubQuest[ QUEST_KINGPIN_MONEY ] == QUESTINPROGRESS || gfBoxersResting || ( !BoxersAvailable() && PythSpacesAway(pKingpin->sGridNo, gModSettings.iKingpinRingTile) > 2 ) );// plus other conditions
|
||||
else
|
||||
gubFact[usFact] = TRUE;
|
||||
break;
|
||||
|
||||
case FACT_MADDOG_IS_SPEAKER:
|
||||
|
||||
@@ -966,6 +966,10 @@ INT32 ClosestReachableDisturbance(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK,
|
||||
continue; // next merc
|
||||
}
|
||||
|
||||
// silversurfer: ignore empty vehicles
|
||||
if ( pOpp->ubWhatKindOfMercAmI == MERC_TYPE__VEHICLE && GetNumberInVehicle( pOpp->bVehicleID ) == 0 )
|
||||
continue;
|
||||
|
||||
pbPersOL = pSoldier->aiData.bOppList + pOpp->ubID;
|
||||
pbPublOL = gbPublicOpplist[pSoldier->bTeam] + pOpp->ubID;
|
||||
psLastLoc = gsLastKnownOppLoc[pSoldier->ubID] + pOpp->ubID;
|
||||
|
||||
Reference in New Issue
Block a user