mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
- Bugfix: If user changes shipping destination location in "ShippingDestinations.xml", Bobby Ray was still under construction if the "original" shipping destination was not under players control.
This occured because of hardcoded DRASSEN AIRPORT COORDINATES (BOBBYR_SHIPPING_DEST_SECTOR_X, BOBBYR_SHIPPING_DEST_SECTOR_Y, BOBBYR_SHIPPING_DEST_SECTOR_Z) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3102 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -952,6 +952,38 @@ UINT16 CPostalService::RemoveDestination(UINT16 usDestinationID)
|
||||
return usDestinationID;
|
||||
}
|
||||
|
||||
// WANNE: This method returns, if a given sector (x, y, z) is a shipment destination sector
|
||||
BOOLEAN CPostalService::IsSectorAShipmentSector(UINT8 ubMapX, UINT8 ubMapY, UINT8 ubMapZ)
|
||||
{
|
||||
BOOLEAN isShipmentSector = FALSE;
|
||||
|
||||
vector<PDestinationStruct> destinations;
|
||||
RefToDestinationListIterator dli = LookupDestinationList().begin();
|
||||
|
||||
while (dli != LookupDestinationList().end())
|
||||
{
|
||||
destinations.push_back(&DESTINATION(dli));
|
||||
dli++;
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < destinations.size(); i++)
|
||||
{
|
||||
PDestinationStruct destStruct = destinations.at(i);
|
||||
if (destStruct)
|
||||
{
|
||||
if (destStruct->ubMapX == ubMapX &&
|
||||
destStruct->ubMapY == ubMapY &&
|
||||
destStruct->ubMapZ == ubMapZ)
|
||||
{
|
||||
isShipmentSector = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isShipmentSector;
|
||||
}
|
||||
|
||||
UINT16 CPostalService::GetShipmentCount(SHIPMENT_STATUS TargetedShipmentStatus)
|
||||
{
|
||||
if(_Shipments.empty())
|
||||
|
||||
@@ -222,6 +222,9 @@ public:
|
||||
UINT16 RemoveDestination(UINT16 usDestinationID);
|
||||
RefToDestinationStruct GetDestination(UINT16 usDestinationID) const;
|
||||
RefToDestinationList LookupDestinationList(void) const;
|
||||
|
||||
// WANNE:
|
||||
BOOLEAN IsSectorAShipmentSector(UINT8 ubMapX, UINT8 ubMapY, UINT8 ubMapZ);
|
||||
|
||||
// Delivery method management
|
||||
UINT8 AddDeliveryMethod(STR16 pszDescription);
|
||||
|
||||
Reference in New Issue
Block a user