mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-09-11 21:44:58 -04:00
Revert "Revert "newer standards prefer nullptr over NULL - this is most of them but there are others too""
This reverts commit 8e2160f33e.
This commit is contained in:
@@ -155,9 +155,9 @@ WearableAppearanceMapNamespace::PersistentMapEntry::PersistentMapEntry(char cons
|
||||
MapEntry(),
|
||||
m_sourceWearableAppearanceName(sourceWearableAppearanceName, true),
|
||||
m_wearerAppearanceName(wearerAppearanceName, true),
|
||||
m_mappedWearableAppearanceName(NULL)
|
||||
m_mappedWearableAppearanceName(nullptr)
|
||||
{
|
||||
if (mappedWearableAppearanceName != NULL)
|
||||
if (mappedWearableAppearanceName != nullptr)
|
||||
m_mappedWearableAppearanceName = new PersistentCrcString(mappedWearableAppearanceName, true);
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ CrcString const &WearableAppearanceMapNamespace::TemporaryMapEntry::getWearerApp
|
||||
|
||||
CrcString const *WearableAppearanceMapNamespace::TemporaryMapEntry::getMappedWearableAppearanceName() const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
@@ -297,7 +297,7 @@ void WearableAppearanceMapNamespace::loadTableData(char const *filename)
|
||||
std::string const &mappedWearableAppearanceName = table->getStringValue(mappedWearableAppearanceNameColumnNumber, rowIndex);
|
||||
|
||||
//-- Create map entry, add to vector.
|
||||
s_mapEntries.push_back(new PersistentMapEntry(sourceWearableAppearanceName.c_str(), wearerAppearanceName.c_str(), (mappedWearableAppearanceName == cs_forbiddenWearableCellContents) ? NULL : mappedWearableAppearanceName.c_str()));
|
||||
s_mapEntries.push_back(new PersistentMapEntry(sourceWearableAppearanceName.c_str(), wearerAppearanceName.c_str(), (mappedWearableAppearanceName == cs_forbiddenWearableCellContents) ? nullptr : mappedWearableAppearanceName.c_str()));
|
||||
}
|
||||
|
||||
DataTableManager::close(filename);
|
||||
@@ -388,7 +388,7 @@ WearableAppearanceMap::MapResult WearableAppearanceMap::getMapResultForWearableA
|
||||
if (findResult.first == findResult.second)
|
||||
{
|
||||
// We have no mapping for this entry. That implies the source wearable appearance name can be used as is.
|
||||
return MapResult(false, false, NULL);
|
||||
return MapResult(false, false, nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -398,7 +398,7 @@ WearableAppearanceMap::MapResult WearableAppearanceMap::getMapResultForWearableA
|
||||
|
||||
// We have a mapping. Return it.
|
||||
CrcString const *const mappedWearableAppearanceName = mapEntry->getMappedWearableAppearanceName();
|
||||
return MapResult(true, mappedWearableAppearanceName == NULL, mappedWearableAppearanceName);
|
||||
return MapResult(true, mappedWearableAppearanceName == nullptr, mappedWearableAppearanceName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -279,8 +279,8 @@ bool CollisionCallbackManager::intersectAndReflectWithTerrain(Object * const obj
|
||||
|
||||
void CollisionCallbackManagerNamespace::noCollisionDetectionThisFrame(Object * const object)
|
||||
{
|
||||
FATAL(!ms_convertObjectToIndex, ("CollisionCallbackManagerNamespace::noCollisionDetectionThisFrame: ms_convertObjectToIndex == NULL."));
|
||||
FATAL(!object, ("CollisionCallbackManagerNamespace::noCollisionDetectionThisFrame: object == NULL."));
|
||||
FATAL(!ms_convertObjectToIndex, ("CollisionCallbackManagerNamespace::noCollisionDetectionThisFrame: ms_convertObjectToIndex == nullptr."));
|
||||
FATAL(!object, ("CollisionCallbackManagerNamespace::noCollisionDetectionThisFrame: object == nullptr."));
|
||||
|
||||
int const index = ms_convertObjectToIndex(object);
|
||||
|
||||
@@ -298,9 +298,9 @@ void CollisionCallbackManagerNamespace::noCollisionDetectionThisFrame(Object * c
|
||||
|
||||
bool CollisionCallbackManagerNamespace::collisionDetectionOnHit(Object * const object, Object * const wasHitByThisObject)
|
||||
{
|
||||
FATAL(!ms_convertObjectToIndex, ("CollisionCallbackManagerNamespace::collisionDetectionOnHit: ms_convertObjectToIndex == NULL."));
|
||||
FATAL(!object, ("CollisionCallbackManagerNamespace::collisionDetectionOnHit: object == NULL."));
|
||||
FATAL(!wasHitByThisObject, ("CollisionCallbackManagerNamespace::collisionDetectionOnHit: wasHitByThisObject == NULL."));
|
||||
FATAL(!ms_convertObjectToIndex, ("CollisionCallbackManagerNamespace::collisionDetectionOnHit: ms_convertObjectToIndex == nullptr."));
|
||||
FATAL(!object, ("CollisionCallbackManagerNamespace::collisionDetectionOnHit: object == nullptr."));
|
||||
FATAL(!wasHitByThisObject, ("CollisionCallbackManagerNamespace::collisionDetectionOnHit: wasHitByThisObject == nullptr."));
|
||||
|
||||
CollisionCallbackManager::OnHitByObjectFunction function = 0;
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ AiDebugString::AiDebugString(std::string const & text)
|
||||
Unicode::String const delimiters(Unicode::narrowToWide("`"));
|
||||
Unicode::UnicodeStringVector result;
|
||||
|
||||
if (Unicode::tokenize(Unicode::narrowToWide(text), result, &delimiters, NULL))
|
||||
if (Unicode::tokenize(Unicode::narrowToWide(text), result, &delimiters, nullptr))
|
||||
{
|
||||
Unicode::UnicodeStringVector::const_iterator iterStringVector = result.begin();
|
||||
|
||||
|
||||
@@ -192,31 +192,31 @@ void AssetCustomizationManagerNamespace::remove()
|
||||
s_installed = false;
|
||||
|
||||
delete [] s_nameDataBlock;
|
||||
s_nameDataBlock = NULL;
|
||||
s_nameDataBlock = nullptr;
|
||||
s_nameDataBlockSize = 0;
|
||||
|
||||
delete [] s_paletteIdNameOffsetMap;
|
||||
s_paletteIdNameOffsetMap = NULL;
|
||||
s_paletteIdNameOffsetMap = nullptr;
|
||||
s_maxValidPaletteId = 0;
|
||||
|
||||
delete [] s_variableIdNameOffsetMap;
|
||||
s_variableIdNameOffsetMap = NULL;
|
||||
s_variableIdNameOffsetMap = nullptr;
|
||||
s_maxValidVariableId = 0;
|
||||
|
||||
delete [] s_defaultValueMap;
|
||||
s_defaultValueMap = NULL;
|
||||
s_defaultValueMap = nullptr;
|
||||
s_maxValidDefaultId = 0;
|
||||
|
||||
delete [] s_intRangeMap;
|
||||
s_intRangeMap = NULL;
|
||||
s_intRangeMap = nullptr;
|
||||
s_maxValidIntRangeId = 0;
|
||||
|
||||
delete [] s_rangeTypeMap;
|
||||
s_rangeTypeMap = NULL;
|
||||
s_rangeTypeMap = nullptr;
|
||||
s_maxValidRangeId = 0;
|
||||
|
||||
delete [] s_variableUsageMap;
|
||||
s_variableUsageMap = NULL;
|
||||
s_variableUsageMap = nullptr;
|
||||
s_maxValidVariableUsageId = 0;
|
||||
|
||||
delete [] s_variableUsageList;
|
||||
@@ -224,19 +224,19 @@ void AssetCustomizationManagerNamespace::remove()
|
||||
s_variableUsageListEntryCount = 0;
|
||||
|
||||
delete [] s_usageIndex;
|
||||
s_usageIndex = NULL;
|
||||
s_usageIndex = nullptr;
|
||||
s_usageIndexEntryCount = 0;
|
||||
|
||||
delete [] s_linkList;
|
||||
s_linkList = NULL;
|
||||
s_linkList = nullptr;
|
||||
s_linkListEntryCount = 0;
|
||||
|
||||
delete [] s_linkIndex;
|
||||
s_linkIndex = NULL;
|
||||
s_linkIndex = nullptr;
|
||||
s_linkIndexEntryCount = 0;
|
||||
|
||||
delete [] s_crcLookupTable;
|
||||
s_crcLookupTable = NULL;
|
||||
s_crcLookupTable = nullptr;
|
||||
s_crcLookupEntryCount = 0;
|
||||
}
|
||||
|
||||
@@ -488,7 +488,7 @@ int AssetCustomizationManagerNamespace::lookupAssetId(CrcString const &assetName
|
||||
uint32 const key = assetName.getCrc();
|
||||
CrcLookupEntry const *entry = static_cast<CrcLookupEntry*>(bsearch(&key, s_crcLookupTable, static_cast<size_t>(s_crcLookupEntryCount), sizeof(CrcLookupEntry), compare_uint32));
|
||||
|
||||
return (entry != NULL) ? entry->assetId : 0;
|
||||
return (entry != nullptr) ? entry->assetId : 0;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -584,7 +584,7 @@ void AssetCustomizationManagerNamespace::addVariablesForAssetAndLinks(int assetI
|
||||
getRangeTypeInfoFromRangeId(variableUsage->rangeId, isPalette, idForRealType);
|
||||
|
||||
//-- Create variable based on type.
|
||||
CustomizationVariable *variable = NULL;
|
||||
CustomizationVariable *variable = nullptr;
|
||||
if (isPalette)
|
||||
{
|
||||
//-- Get palette.
|
||||
|
||||
@@ -63,7 +63,7 @@ void CitizenRankDataTable::install()
|
||||
FATAL((columnRankSlotId < 0), ("column \"rankSlotId\" not found in %s", cs_citizenRankDataTableName));
|
||||
FATAL((columnTitle < 0), ("column \"title\" not found in %s", cs_citizenRankDataTableName));
|
||||
|
||||
CitizenRankDataTable::CitizenRank const * currentRank = NULL;
|
||||
CitizenRankDataTable::CitizenRank const * currentRank = nullptr;
|
||||
|
||||
int const numRows = table->getNumRows();
|
||||
std::string rankName, alternateTitle;
|
||||
@@ -199,7 +199,7 @@ CitizenRankDataTable::CitizenRank const * CitizenRankDataTable::getRank(std::str
|
||||
if (iterFind != s_allCitizenRanksByName.end())
|
||||
return iterFind->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -210,7 +210,7 @@ CitizenRankDataTable::CitizenRank const * CitizenRankDataTable::isARankTitle(std
|
||||
if (iterFind != s_allCitizenRanksByTitle.end())
|
||||
return iterFind->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace CollectionsDataTableNamespace
|
||||
// for quick lookup of a slot by begin slot id, we use a vector because
|
||||
// slot id are guaranteed to start at 0 and be contiguous; for counter-type
|
||||
// slot, only the begin slot id index points to the slot; the other slot
|
||||
// id indices point to NULL
|
||||
// id indices point to nullptr
|
||||
std::vector<CollectionsDataTable::CollectionInfoSlot const *> s_allSlotsById;
|
||||
|
||||
// all title(able) slots
|
||||
@@ -232,10 +232,10 @@ void CollectionsDataTable::install()
|
||||
FATAL((columnNoReward < 0), ("column \"noReward\" not found in %s", cs_collectionsDataTableName));
|
||||
FATAL((columnTrackServerFirst < 0), ("column \"trackServerFirst\" not found in %s", cs_collectionsDataTableName));
|
||||
|
||||
CollectionsDataTable::CollectionInfoBook const * currentBook = NULL;
|
||||
CollectionsDataTable::CollectionInfoPage const * currentPage = NULL;
|
||||
CollectionsDataTable::CollectionInfoCollection const * currentCollection = NULL;
|
||||
CollectionsDataTable::CollectionInfoSlot const * currentSlot = NULL;
|
||||
CollectionsDataTable::CollectionInfoBook const * currentBook = nullptr;
|
||||
CollectionsDataTable::CollectionInfoPage const * currentPage = nullptr;
|
||||
CollectionsDataTable::CollectionInfoCollection const * currentCollection = nullptr;
|
||||
CollectionsDataTable::CollectionInfoSlot const * currentSlot = nullptr;
|
||||
|
||||
int const numRows = table->getNumRows();
|
||||
std::string bookName, pageName, collectionName, slotName, category, prereq, alternateTitle, icon, music;
|
||||
@@ -350,8 +350,8 @@ void CollectionsDataTable::install()
|
||||
FATAL(title, ("%s: book %s cannot be \"titleable\")", cs_collectionsDataTableName, bookName.c_str()));
|
||||
FATAL(!titles.empty(), ("%s: book %s cannot have any alternate titles (books are not \"titleable\")", cs_collectionsDataTableName, bookName.c_str()));
|
||||
currentBook = new CollectionInfoBook(bookName, icon, showIfNotYetEarned, hidden);
|
||||
currentPage = NULL;
|
||||
currentCollection = NULL;
|
||||
currentPage = nullptr;
|
||||
currentCollection = nullptr;
|
||||
s_allBooks.push_back(currentBook);
|
||||
s_allBooksByName[bookName] = currentBook;
|
||||
}
|
||||
@@ -376,7 +376,7 @@ void CollectionsDataTable::install()
|
||||
// start new page
|
||||
FATAL((!titles.empty() && !title), ("%s: page %s cannot have any alternate titles unless it is defined as \"titleable\")", cs_collectionsDataTableName, pageName.c_str()));
|
||||
currentPage = new CollectionInfoPage(pageName, icon, showIfNotYetEarned, hidden, titles, *currentBook);
|
||||
currentCollection = NULL;
|
||||
currentCollection = nullptr;
|
||||
s_pagesInBook[currentBook->name].push_back(currentPage);
|
||||
s_allPagesByName[pageName] = currentPage;
|
||||
|
||||
@@ -549,7 +549,7 @@ void CollectionsDataTable::install()
|
||||
IGNORE_RETURN(s_slotCategoriesByCollection[currentCollection->name].insert(*iterCategories));
|
||||
}
|
||||
|
||||
currentSlot = NULL;
|
||||
currentSlot = nullptr;
|
||||
categories.clear();
|
||||
prereqs.clear();
|
||||
}
|
||||
@@ -575,7 +575,7 @@ void CollectionsDataTable::install()
|
||||
}
|
||||
|
||||
// save off all slots ordered by slot ids
|
||||
s_allSlotsById.resize(allSlotsById.size(), NULL);
|
||||
s_allSlotsById.resize(allSlotsById.size(), nullptr);
|
||||
beginSlotId = -1;
|
||||
for (std::map<int, CollectionsDataTable::CollectionInfoSlot const *>::const_iterator iterSlotId = allSlotsById.begin(); iterSlotId != allSlotsById.end(); ++iterSlotId)
|
||||
{
|
||||
@@ -612,7 +612,7 @@ void CollectionsDataTable::install()
|
||||
}
|
||||
else
|
||||
{
|
||||
s_allSlotsById[iterSlotId->first] = NULL;
|
||||
s_allSlotsById[iterSlotId->first] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -733,7 +733,7 @@ CollectionsDataTable::CollectionInfoSlot const * CollectionsDataTable::getSlotBy
|
||||
if (iterFind != s_allSlotsByName.end())
|
||||
return iterFind->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -743,7 +743,7 @@ CollectionsDataTable::CollectionInfoSlot const * CollectionsDataTable::getSlotBy
|
||||
CollectionsDataTable::CollectionInfoSlot const * CollectionsDataTable::getSlotByBeginSlotId(int slotId)
|
||||
{
|
||||
if ((slotId < 0) || (slotId >= static_cast<int>(s_allSlotsById.size())))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return s_allSlotsById[slotId];
|
||||
}
|
||||
@@ -763,7 +763,7 @@ CollectionsDataTable::CollectionInfoSlot const * CollectionsDataTable::isASlotTi
|
||||
if (iterFind != s_allSlotTitles.end())
|
||||
return iterFind->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -796,7 +796,7 @@ CollectionsDataTable::CollectionInfoCollection const * CollectionsDataTable::isA
|
||||
if (iterFind != s_allCollectionTitles.end())
|
||||
return iterFind->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -818,7 +818,7 @@ CollectionsDataTable::CollectionInfoCollection const * CollectionsDataTable::get
|
||||
if (iterFind != s_allCollectionsByName.end())
|
||||
return iterFind->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -866,7 +866,7 @@ CollectionsDataTable::CollectionInfoPage const * CollectionsDataTable::isAPageTi
|
||||
if (iterFind != s_allPageTitles.end())
|
||||
return iterFind->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -879,7 +879,7 @@ CollectionsDataTable::CollectionInfoPage const * CollectionsDataTable::getPageBy
|
||||
if (iterFind != s_allPagesByName.end())
|
||||
return iterFind->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -946,7 +946,7 @@ CollectionsDataTable::CollectionInfoBook const * CollectionsDataTable::getBookBy
|
||||
if (iterFind != s_allBooksByName.end())
|
||||
return iterFind->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
+3
-3
@@ -125,7 +125,7 @@ void CommoditiesAdvancedSearchAttribute::install()
|
||||
{
|
||||
// handle search attribute name alias
|
||||
tokens.clear();
|
||||
if (Unicode::tokenize(Unicode::narrowToWide(searchAttributeName), tokens, NULL, NULL) && (tokens.size() > 1))
|
||||
if (Unicode::tokenize(Unicode::narrowToWide(searchAttributeName), tokens, nullptr, nullptr) && (tokens.size() > 1))
|
||||
{
|
||||
// the first value is the search attribute name to display
|
||||
searchAttributeName = Unicode::wideToNarrow(tokens[0]);
|
||||
@@ -177,7 +177,7 @@ void CommoditiesAdvancedSearchAttribute::install()
|
||||
{
|
||||
// for enum, parse out the aliases (if any) for the enum value
|
||||
tokens.clear();
|
||||
if (Unicode::tokenize(Unicode::narrowToWide(defaultSearchValue), tokens, NULL, NULL) && !tokens.empty())
|
||||
if (Unicode::tokenize(Unicode::narrowToWide(defaultSearchValue), tokens, nullptr, nullptr) && !tokens.empty())
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#ifdef _DEBUG
|
||||
@@ -340,7 +340,7 @@ CommoditiesAdvancedSearchAttribute::SearchAttribute const * CommoditiesAdvancedS
|
||||
return iterFindAttribute->second;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@@ -441,7 +441,7 @@ CustomizationVariable * CustomizationManager::findVariable (CustomizationData &
|
||||
if(!ms_installed)
|
||||
{
|
||||
DEBUG_FATAL(true, ("CustomizationManager not installed"));
|
||||
return NULL; //lint !e527 unreachable (reachable in release)
|
||||
return nullptr; //lint !e527 unreachable (reachable in release)
|
||||
}
|
||||
|
||||
PathType type = PT_none;
|
||||
@@ -455,7 +455,7 @@ CustomizationVariable * CustomizationManager::findVariable (CustomizationData &
|
||||
if(!ms_installed)
|
||||
{
|
||||
DEBUG_FATAL(true, ("CustomizationManager not installed"));
|
||||
return NULL; //lint !e527 unreachable (reachable in release)
|
||||
return nullptr; //lint !e527 unreachable (reachable in release)
|
||||
}
|
||||
|
||||
type = PT_none;
|
||||
@@ -467,7 +467,7 @@ CustomizationVariable * CustomizationManager::findVariable (CustomizationData &
|
||||
{
|
||||
//if we have the ranged customization variable is a dependent variable, ignore it (there will be another that controls it)
|
||||
if(rangedCV->getIsDependentVariable())
|
||||
cv = NULL;
|
||||
cv = nullptr;
|
||||
}
|
||||
|
||||
if (!cv)
|
||||
|
||||
@@ -81,10 +81,10 @@ FormManager::Field::Field(Form const * const parent)
|
||||
FormManager::Field::~Field()
|
||||
{
|
||||
delete m_choices;
|
||||
m_choices = NULL;
|
||||
m_choices = nullptr;
|
||||
delete m_otherValidationRules;
|
||||
m_otherValidationRules = NULL;
|
||||
m_parentForm = NULL;
|
||||
m_otherValidationRules = nullptr;
|
||||
m_parentForm = nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -453,12 +453,12 @@ FormManager::Form::~Form()
|
||||
{
|
||||
//this vector does NOT own the pointers
|
||||
delete m_orderedFieldList;
|
||||
m_orderedFieldList = NULL;
|
||||
m_orderedFieldList = nullptr;
|
||||
|
||||
//this list owns the pointers, so release it
|
||||
std::for_each(m_fields->begin(), m_fields->end(), PointerDeleterPairSecond());
|
||||
delete m_fields;
|
||||
m_fields = NULL;
|
||||
m_fields = nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -477,7 +477,7 @@ FormManager::Field const * FormManager::Form::getField(std::string const & field
|
||||
if(i != m_fields->end())
|
||||
return i->second;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -531,13 +531,13 @@ void FormManager::remove ()
|
||||
clearData();
|
||||
|
||||
delete ms_forms;
|
||||
ms_forms = NULL;
|
||||
ms_forms = nullptr;
|
||||
delete ms_serverObjectTemplateToForms;
|
||||
ms_serverObjectTemplateToForms = NULL;
|
||||
ms_serverObjectTemplateToForms = nullptr;
|
||||
delete ms_sharedObjectTemplateToForms;
|
||||
ms_sharedObjectTemplateToForms = NULL;
|
||||
ms_sharedObjectTemplateToForms = nullptr;
|
||||
delete ms_automaticallyCreateObjectForServerObjectTemplate;
|
||||
ms_automaticallyCreateObjectForServerObjectTemplate = NULL;
|
||||
ms_automaticallyCreateObjectForServerObjectTemplate = nullptr;
|
||||
|
||||
s_tablesLoaded = false;
|
||||
s_installed = false;
|
||||
@@ -764,13 +764,13 @@ FormManager::Form const * FormManager::getFormByName(std::string const & formNam
|
||||
{
|
||||
DEBUG_FATAL (!s_installed, ("not installed"));
|
||||
if(!s_installed)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
std::map<std::string, Form*>::iterator i = ms_forms->find(formName);
|
||||
if(i != ms_forms->end())
|
||||
return i->second;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -779,13 +779,13 @@ FormManager::Form const * FormManager::getFormForServerObjectTemplate(std::strin
|
||||
{
|
||||
DEBUG_FATAL (!s_installed, ("not installed"));
|
||||
if(!s_installed)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
std::map<std::string, const Form*>::iterator i = ms_serverObjectTemplateToForms->find(serverTemplateName);
|
||||
if(i != ms_serverObjectTemplateToForms->end())
|
||||
return i->second;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -794,13 +794,13 @@ FormManager::Form const * FormManager::getFormForSharedObjectTemplate(std::strin
|
||||
{
|
||||
DEBUG_FATAL (!s_installed, ("not installed"));
|
||||
if(!s_installed)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
std::map<std::string, const Form*>::iterator i = ms_sharedObjectTemplateToForms->find(sharedTemplateName);
|
||||
if(i != ms_sharedObjectTemplateToForms->end())
|
||||
return i->second;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@@ -74,7 +74,7 @@ void GameScheduler::remove()
|
||||
DEBUG_FATAL(!s_installed, ("GameScheduler not installed."));
|
||||
|
||||
delete s_scheduler;
|
||||
s_scheduler = NULL;
|
||||
s_scheduler = nullptr;
|
||||
|
||||
s_installed = false;
|
||||
}
|
||||
|
||||
@@ -103,12 +103,12 @@ BuildoutArea const * GroundZoneManager::getZoneName(std::string const & sceneNam
|
||||
|
||||
if(!SharedBuildoutAreaManager::isBuildoutScene(sceneName))
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
BuildoutArea const * const ba = SharedBuildoutAreaManager::findBuildoutAreaAtPosition(sceneName, location_w.x, location_w.z, true);
|
||||
if (NULL != ba)
|
||||
if (nullptr != ba)
|
||||
{
|
||||
if (!ba->compositeName.empty())
|
||||
zoneName = ba->compositeName;
|
||||
@@ -126,7 +126,7 @@ Vector GroundZoneManager::transformWorldLocationToZoneLocation(std::string const
|
||||
Vector pos_w = location_w;
|
||||
std::string zoneName;
|
||||
BuildoutArea const * const ba = GroundZoneManager::getZoneName(sceneName, location_w, zoneName);
|
||||
if (NULL != ba)
|
||||
if (nullptr != ba)
|
||||
{
|
||||
pos_w = ba->getRelativePosition(location_w, true);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ void GuildRankDataTable::install()
|
||||
FATAL((columnRankSlotId < 0), ("column \"rankSlotId\" not found in %s", cs_guildRankDataTableName));
|
||||
FATAL((columnTitle < 0), ("column \"title\" not found in %s", cs_guildRankDataTableName));
|
||||
|
||||
GuildRankDataTable::GuildRank const * currentRank = NULL;
|
||||
GuildRankDataTable::GuildRank const * currentRank = nullptr;
|
||||
|
||||
int const numRows = table->getNumRows();
|
||||
std::string rankName, alternateTitle;
|
||||
@@ -207,7 +207,7 @@ GuildRankDataTable::GuildRank const * GuildRankDataTable::getRank(std::string co
|
||||
if (iterFind != s_allGuildRanksByName.end())
|
||||
return iterFind->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -218,7 +218,7 @@ GuildRankDataTable::GuildRank const * GuildRankDataTable::getRankForDisplayRankN
|
||||
if (iterFind != s_allGuildRanksByDisplayName.end())
|
||||
return iterFind->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -229,7 +229,7 @@ GuildRankDataTable::GuildRank const * GuildRankDataTable::isARankTitle(std::stri
|
||||
if (iterFind != s_allGuildRanksByTitle.end())
|
||||
return iterFind->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -1127,7 +1127,7 @@ std::map<std::string, int> const & LfgCharacterData::calculateStatistics(std::ma
|
||||
}
|
||||
}
|
||||
|
||||
int32 const timeNow = static_cast<int32>(::time(NULL));
|
||||
int32 const timeNow = static_cast<int32>(::time(nullptr));
|
||||
for (std::map<NetworkId, LfgCharacterData>::const_iterator iterLfgData = connectedCharacterLfgData.begin(); iterLfgData != connectedCharacterLfgData.end(); ++iterLfgData)
|
||||
{
|
||||
// searchable/anonymous
|
||||
|
||||
@@ -379,10 +379,10 @@ void LfgDataTable::install()
|
||||
unsigned long maxValueForNumBits;
|
||||
std::map<std::string, int> names;
|
||||
std::map<int, LfgNode const *> allSlotsById;
|
||||
LfgNode * lfgNode = NULL;
|
||||
LfgNode * currentTier1Node = NULL;
|
||||
LfgNode * currentTier2Node = NULL;
|
||||
LfgNode * currentTier3Node = NULL;
|
||||
LfgNode * lfgNode = nullptr;
|
||||
LfgNode * currentTier1Node = nullptr;
|
||||
LfgNode * currentTier2Node = nullptr;
|
||||
LfgNode * currentTier3Node = nullptr;
|
||||
|
||||
for (int i = 0; i < numRows; ++i)
|
||||
{
|
||||
@@ -472,15 +472,15 @@ void LfgDataTable::install()
|
||||
FATAL(((minValue > 0) && (maxValueBeginSlotId < 0)), ("%s, row %d: minValueBeginSlotId/minValueEndSlotId/maxValueBeginSlotId/maxValueEndSlotId must be specified if minValue/maxValue is specified", cs_lfgDataTableName, (i+3)));
|
||||
|
||||
// create a new node
|
||||
lfgNode = NULL;
|
||||
lfgNode = nullptr;
|
||||
if (!tier1.empty())
|
||||
{
|
||||
lfgNode = new LfgNode(tier1, internalAttribute, minValueBeginSlotId, minValueEndSlotId, maxValueBeginSlotId, maxValueEndSlotId, minValue, maxValue, defaultMatchCondition, NULL);
|
||||
lfgNode = new LfgNode(tier1, internalAttribute, minValueBeginSlotId, minValueEndSlotId, maxValueBeginSlotId, maxValueEndSlotId, minValue, maxValue, defaultMatchCondition, nullptr);
|
||||
s_topLevelNodes.push_back(lfgNode);
|
||||
|
||||
currentTier1Node = lfgNode;
|
||||
currentTier2Node = NULL;
|
||||
currentTier3Node = NULL;
|
||||
currentTier2Node = nullptr;
|
||||
currentTier3Node = nullptr;
|
||||
}
|
||||
else if (!tier2.empty())
|
||||
{
|
||||
@@ -490,7 +490,7 @@ void LfgDataTable::install()
|
||||
currentTier1Node->children.push_back(lfgNode);
|
||||
|
||||
currentTier2Node = lfgNode;
|
||||
currentTier3Node = NULL;
|
||||
currentTier3Node = nullptr;
|
||||
}
|
||||
else if (!tier3.empty())
|
||||
{
|
||||
@@ -580,7 +580,7 @@ void LfgDataTable::install()
|
||||
|
||||
// find out the leaf node's ancestor, if any, that has the Any/All option
|
||||
LfgNode const * parentNode = node.parent;
|
||||
bool const hasParent = (parentNode != NULL);
|
||||
bool const hasParent = (parentNode != nullptr);
|
||||
int countParentWithNonNaDefaultMatchCondition = 0;
|
||||
std::string stringParentWithNonNaDefaultMatchCondition;
|
||||
while (parentNode)
|
||||
@@ -670,7 +670,7 @@ LfgDataTable::LfgNode const * LfgDataTable::getLfgNodeByName(std::string const &
|
||||
{
|
||||
std::map<std::string, LfgNode const *>::const_iterator iterNode = s_allNodesByName.find(lfgNodeName);
|
||||
if (iterNode == s_allNodesByName.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return iterNode->second;
|
||||
}
|
||||
@@ -681,7 +681,7 @@ LfgDataTable::LfgNode const * LfgDataTable::getLfgLeafNodeByName(std::string con
|
||||
{
|
||||
std::map<std::string, LfgNode const *>::const_iterator iterNode = s_allLeafNodesByName.find(lfgNodeName);
|
||||
if (iterNode == s_allLeafNodesByName.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return iterNode->second;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
{
|
||||
public:
|
||||
LfgNode(std::string const & pName, bool pInternalAttribute, int pMinValueBeginSlotId, int pMinValueEndSlotId, int pMaxValueBeginSlotId, int pMaxValueEndSlotId, int pMinValue, int pMaxValue, DefaultMatchConditionType pDefaultMatchCondition, LfgNode const * pParent) :
|
||||
name(pName), internalAttribute(pInternalAttribute), minValueBeginSlotId(pMinValueBeginSlotId), minValueEndSlotId(pMinValueEndSlotId), maxValueBeginSlotId(pMaxValueBeginSlotId), maxValueEndSlotId(pMaxValueEndSlotId), minValue(pMinValue), maxValue(pMaxValue), defaultMatchCondition(pDefaultMatchCondition), actualMatchCondition(DMCT_NA), parent(pParent), anyAllGroupingParent(NULL), children(), hasAnyInternalAttributeLeafNodeDescendants(false), hasAnyExternalAttributeLeafNodeDescendants(false), internalAttributeMatchFunction(NULL) {};
|
||||
name(pName), internalAttribute(pInternalAttribute), minValueBeginSlotId(pMinValueBeginSlotId), minValueEndSlotId(pMinValueEndSlotId), maxValueBeginSlotId(pMaxValueBeginSlotId), maxValueEndSlotId(pMaxValueEndSlotId), minValue(pMinValue), maxValue(pMaxValue), defaultMatchCondition(pDefaultMatchCondition), actualMatchCondition(DMCT_NA), parent(pParent), anyAllGroupingParent(nullptr), children(), hasAnyInternalAttributeLeafNodeDescendants(false), hasAnyExternalAttributeLeafNodeDescendants(false), internalAttributeMatchFunction(nullptr) {};
|
||||
|
||||
std::string const name;
|
||||
bool const internalAttribute;
|
||||
|
||||
@@ -530,9 +530,9 @@ void PlayerCreationManager::buildRacialMinsMaxes()
|
||||
|
||||
const DataTable * dt = DataTableManager::getTable(
|
||||
"datatables/creation/attribute_limits.iff", true);
|
||||
WARNING_STRICT_FATAL(dt == NULL, ("Unable to read the "
|
||||
WARNING_STRICT_FATAL(dt == nullptr, ("Unable to read the "
|
||||
"attribute_limits datatable"));
|
||||
if (dt == NULL)
|
||||
if (dt == nullptr)
|
||||
return;
|
||||
|
||||
int numAttribs = dt->getNumColumns() - 1;
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace SharedBuffBuilderManagerNamespace
|
||||
const std::string ms_reactiveSecondChanceComponentName = "reactive_second_chance";
|
||||
}
|
||||
|
||||
SharedBuffBuilderManager::BuffBuilderDataType * SharedBuffBuilderManager::ms_buffBuilderData=NULL;
|
||||
SharedBuffBuilderManager::BuffBuilderDataType * SharedBuffBuilderManager::ms_buffBuilderData=nullptr;
|
||||
using namespace SharedBuffBuilderManagerNamespace;
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -321,7 +321,7 @@ std::string SharedBuildoutAreaManager::getBuildoutNameForPosition(std::string co
|
||||
{
|
||||
BuildoutArea const * const ba = findBuildoutAreaAtPosition(sceneName, location_w.x, location_w.z, ignoreInternal, ignoreNonActiveEvents);
|
||||
|
||||
if (NULL != ba)
|
||||
if (nullptr != ba)
|
||||
return sceneName + cms_sceneAndAreaDelimeter + ba->areaName;
|
||||
|
||||
return sceneName;
|
||||
@@ -537,7 +537,7 @@ SharedBuildoutAreaManager::BuildoutAreaVector const * SharedBuildoutAreaManager:
|
||||
{
|
||||
return &it->second;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -546,8 +546,8 @@ BuildoutArea const * SharedBuildoutAreaManager::findBuildoutAreaAtPosition(std::
|
||||
{
|
||||
BuildoutAreaVector const * const bav = findBuildoutAreasForScene(sceneId);
|
||||
|
||||
if (NULL == bav)
|
||||
return NULL;
|
||||
if (nullptr == bav)
|
||||
return nullptr;
|
||||
|
||||
for (BuildoutAreaVector::const_iterator it = bav->begin(); it != bav->end(); ++it)
|
||||
{
|
||||
@@ -567,7 +567,7 @@ BuildoutArea const * SharedBuildoutAreaManager::findBuildoutAreaAtPosition(std::
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@@ -579,11 +579,11 @@ BuildoutArea const * SharedBuildoutAreaManager::findBuildoutAreaAtPosition(float
|
||||
|
||||
if (ignoreInternal && buildoutArea.internalBuildoutArea)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if(ignoreNonActiveEvents && !buildoutArea.requiredEventName.empty())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
if (buildoutArea.isLocationInside(x, z))
|
||||
{
|
||||
@@ -591,7 +591,7 @@ BuildoutArea const * SharedBuildoutAreaManager::findBuildoutAreaAtPosition(float
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@@ -358,7 +358,7 @@ bool SharedImageDesignerManager::isSessionValid(SharedImageDesignerManager::Sess
|
||||
if(customizationDataHair)
|
||||
customizationDataForThisCustomization = customizationDataHair;
|
||||
else
|
||||
customizationDataForThisCustomization = NULL;
|
||||
customizationDataForThisCustomization = nullptr;
|
||||
}
|
||||
|
||||
if(customizationDataForThisCustomization)
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
|
||||
// ======================================================================
|
||||
|
||||
Universe * Universe::ms_theInstance = NULL;
|
||||
Universe * Universe::ms_theInstance = nullptr;
|
||||
bool Universe::ms_installed = false;
|
||||
|
||||
//===================================================================
|
||||
|
||||
void Universe::installDerived(Universe *derivedInstance)
|
||||
{
|
||||
DEBUG_FATAL(ms_installed || ms_theInstance!=NULL,("Installed Universe twice.\n"));
|
||||
DEBUG_FATAL(ms_installed || ms_theInstance!=nullptr,("Installed Universe twice.\n"));
|
||||
ms_theInstance = derivedInstance;
|
||||
ms_installed = true;
|
||||
|
||||
@@ -43,7 +43,7 @@ void Universe::remove()
|
||||
Universe::Universe() :
|
||||
m_resourceClassNameMap (new ResourceClassNameMap),
|
||||
m_resourceClassNameCrcMap (new ResourceClassNameCrcMap),
|
||||
m_resourceTreeRoot (NULL)
|
||||
m_resourceTreeRoot (nullptr)
|
||||
{
|
||||
ResourceClassObject::install(); // sets up some static strings used by the import process
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace Archive
|
||||
put(target, source.m_networkId);
|
||||
put(target, source.m_objectTemplate);
|
||||
|
||||
bool isWeapon = (source.m_weaponSharedBaselines.get() != NULL);
|
||||
bool isWeapon = (source.m_weaponSharedBaselines.get() != nullptr);
|
||||
put(target, isWeapon);
|
||||
if (isWeapon)
|
||||
{
|
||||
|
||||
@@ -248,7 +248,7 @@ void MountValidScaleRangeTableNamespace::loadTableData(char const *filename)
|
||||
TemporaryCrcString const mountableCreatureAppearanceNameCrc(mountableCreatureAppearanceName.c_str(), true);
|
||||
|
||||
//-- Find or create new MountableCreature instance for this creature name.
|
||||
MountableCreature *mountableCreature = NULL;
|
||||
MountableCreature *mountableCreature = nullptr;
|
||||
|
||||
MountableCreatureTable::iterator lowerBoundIt = s_mountableCreatureTable.lower_bound((const CrcString*)&mountableCreatureAppearanceNameCrc);
|
||||
bool const mountableCreatureEntryExists = ((lowerBoundIt != s_mountableCreatureTable.end()) && !s_mountableCreatureTable.key_comp()(static_cast<CrcString const*>(&mountableCreatureAppearanceNameCrc), lowerBoundIt->first));
|
||||
@@ -289,7 +289,7 @@ MountValidScaleRangeTableNamespace::MountableCreature const *MountValidScaleRang
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("'datatables/mount/valid_scale_range.iff' missing entry for creature appearance name '%s'", creatureAppearanceName.getString()));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -433,7 +433,7 @@ int SharedSaddleManagerNamespace::TemporaryRiderPoseMapEntry::getRiderSeatIndex(
|
||||
|
||||
CrcString const *SharedSaddleManagerNamespace::TemporaryRiderPoseMapEntry::getRiderPoseName() const
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -39,8 +39,8 @@ using namespace ResourceClassObjectNamespace;
|
||||
|
||||
ResourceClassObject::ResourceClassObject() :
|
||||
m_resourceClassName(),
|
||||
m_parentClass(NULL),
|
||||
m_friendlyName(NULL),
|
||||
m_parentClass(nullptr),
|
||||
m_friendlyName(nullptr),
|
||||
m_minTypes(0),
|
||||
m_maxTypes(0),
|
||||
m_minPools(0),
|
||||
@@ -49,7 +49,7 @@ ResourceClassObject::ResourceClassObject() :
|
||||
m_nameTable(),
|
||||
m_recycled(false),
|
||||
m_permanent(false),
|
||||
m_recycledVersion(NULL),
|
||||
m_recycledVersion(nullptr),
|
||||
m_resourceAttributeRanges(new ResourceAttributeRangesType()),
|
||||
m_children(new ClassList)
|
||||
{
|
||||
@@ -60,18 +60,18 @@ ResourceClassObject::ResourceClassObject() :
|
||||
ResourceClassObject::~ResourceClassObject()
|
||||
{
|
||||
delete m_children;
|
||||
m_children = NULL;
|
||||
m_children = nullptr;
|
||||
|
||||
delete m_resourceAttributeRanges;
|
||||
m_resourceAttributeRanges = NULL;
|
||||
m_resourceAttributeRanges = nullptr;
|
||||
|
||||
m_parentClass = NULL;
|
||||
m_recycledVersion = NULL;
|
||||
m_parentClass = nullptr;
|
||||
m_recycledVersion = nullptr;
|
||||
|
||||
if (m_friendlyName != NULL)
|
||||
if (m_friendlyName != nullptr)
|
||||
{
|
||||
delete m_friendlyName;
|
||||
m_friendlyName = NULL;
|
||||
m_friendlyName = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ ResourceClassObject::ResourceAttributeRangesType const & ResourceClassObject::ge
|
||||
{
|
||||
static const ResourceAttributeRangesType emptyRanges;
|
||||
|
||||
if (m_resourceAttributeRanges != NULL)
|
||||
if (m_resourceAttributeRanges != nullptr)
|
||||
return *m_resourceAttributeRanges;
|
||||
return emptyRanges;
|
||||
}
|
||||
@@ -304,7 +304,7 @@ void ResourceClassObject::loadTreeFromIff()
|
||||
int numRows = resourceDataTable->getNumRows();
|
||||
ResourceClassObject * parents[8];
|
||||
for (int i=0; i<8; ++i)
|
||||
parents[i]=NULL;
|
||||
parents[i]=nullptr;
|
||||
|
||||
static const std::string colName_resourceClassName = "ENUM";
|
||||
static const std::string colName_maxTypes = "Maximum # types";
|
||||
@@ -334,7 +334,7 @@ void ResourceClassObject::loadTreeFromIff()
|
||||
if (possibleName.size()!=0)
|
||||
{
|
||||
if (wheresTheName==0)
|
||||
newClass->m_parentClass = NULL;
|
||||
newClass->m_parentClass = nullptr;
|
||||
else
|
||||
{
|
||||
newClass->m_parentClass = parents[wheresTheName-1];
|
||||
@@ -438,12 +438,12 @@ bool ResourceClassObject::isLeaf() const
|
||||
|
||||
void ResourceClassObject::getChildren(std::vector<const ResourceClassObject *> & children, bool recurse) const
|
||||
{
|
||||
if (m_children == NULL)
|
||||
if (m_children == nullptr)
|
||||
return;
|
||||
|
||||
for (ClassList::const_iterator i = m_children->begin(); i != m_children->end(); ++i)
|
||||
{
|
||||
if (*i != NULL)
|
||||
if (*i != nullptr)
|
||||
{
|
||||
children.push_back(*i);
|
||||
if (recurse)
|
||||
@@ -456,12 +456,12 @@ void ResourceClassObject::getChildren(std::vector<const ResourceClassObject *> &
|
||||
|
||||
void ResourceClassObject::getLeafChildren(std::vector<const ResourceClassObject *> & children) const
|
||||
{
|
||||
if (m_children == NULL)
|
||||
if (m_children == nullptr)
|
||||
return;
|
||||
|
||||
for (ClassList::const_iterator i = m_children->begin(); i != m_children->end(); ++i)
|
||||
{
|
||||
if (*i != NULL)
|
||||
if (*i != nullptr)
|
||||
{
|
||||
if ((*i)->isLeaf())
|
||||
children.push_back(*i);
|
||||
@@ -493,7 +493,7 @@ ResourceClassObject const * ResourceClassObject::getRecycledVersion() const
|
||||
return m_recycledVersion;
|
||||
else if (m_parentClass)
|
||||
return m_parentClass->getRecycledVersion();
|
||||
else return NULL;
|
||||
else return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -118,7 +118,7 @@ inline const StringId & ResourceClassObject::getFriendlyName () const
|
||||
|
||||
inline bool ResourceClassObject::isRoot() const
|
||||
{
|
||||
return (m_parentClass == NULL);
|
||||
return (m_parentClass == nullptr);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -160,7 +160,7 @@ WaypointDataBase::WaypointDataBase() :
|
||||
void WaypointDataBase::setName(Unicode::String const &name)
|
||||
{
|
||||
//This magical number (250) is chosen because the waypoint datatable has VARCHAR2(512) in this column,
|
||||
//and we're assuming 2 bytes per char (which is not quite true actually) plus an extra one for null plus
|
||||
//and we're assuming 2 bytes per char (which is not quite true actually) plus an extra one for nullptr plus
|
||||
//a few extra for good measure and because nobody needs 251-character waypoint names.
|
||||
if (name.length() > 250)
|
||||
{
|
||||
|
||||
+53
-53
@@ -95,10 +95,10 @@ Tag SharedBattlefieldMarkerObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedBattlefieldMarkerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = dynamic_cast<const SharedBattlefieldMarkerObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedBattlefieldMarkerObjectTemplate::getHighestTemplateVersion
|
||||
@@ -112,26 +112,26 @@ int testDataValue = 0;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedBattlefieldMarkerObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getNumberOfPoles(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_numberOfPoles.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter numberOfPoles in template %s", DataResource::getName()));
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter numberOfPoles has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter numberOfPoles has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getNumberOfPoles();
|
||||
}
|
||||
}
|
||||
@@ -141,9 +141,9 @@ UNREF(testData);
|
||||
if (delta == '+' || delta == '-' || delta == '_' || delta == '=')
|
||||
{
|
||||
int baseValue = 0;
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
if (base != NULL)
|
||||
if (base != nullptr)
|
||||
baseValue = base->getNumberOfPoles();
|
||||
else if (ms_allowDefaultTemplateParams)
|
||||
DEBUG_WARNING(true, ("No base template for delta, using 0"));
|
||||
@@ -160,7 +160,7 @@ UNREF(testData);
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -176,26 +176,26 @@ int testDataValue = 0;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedBattlefieldMarkerObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getNumberOfPolesMin(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_numberOfPoles.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter numberOfPoles in template %s", DataResource::getName()));
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter numberOfPoles has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter numberOfPoles has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getNumberOfPolesMin();
|
||||
}
|
||||
}
|
||||
@@ -205,9 +205,9 @@ UNREF(testData);
|
||||
if (delta == '+' || delta == '-' || delta == '_' || delta == '=')
|
||||
{
|
||||
int baseValue = 0;
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
if (base != NULL)
|
||||
if (base != nullptr)
|
||||
baseValue = base->getNumberOfPolesMin();
|
||||
else if (ms_allowDefaultTemplateParams)
|
||||
DEBUG_WARNING(true, ("No base template for delta, using 0"));
|
||||
@@ -224,7 +224,7 @@ UNREF(testData);
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -240,26 +240,26 @@ int testDataValue = 0;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedBattlefieldMarkerObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getNumberOfPolesMax(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_numberOfPoles.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter numberOfPoles in template %s", DataResource::getName()));
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter numberOfPoles has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter numberOfPoles has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getNumberOfPolesMax();
|
||||
}
|
||||
}
|
||||
@@ -269,9 +269,9 @@ UNREF(testData);
|
||||
if (delta == '+' || delta == '-' || delta == '_' || delta == '=')
|
||||
{
|
||||
int baseValue = 0;
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
if (base != NULL)
|
||||
if (base != nullptr)
|
||||
baseValue = base->getNumberOfPolesMax();
|
||||
else if (ms_allowDefaultTemplateParams)
|
||||
DEBUG_WARNING(true, ("No base template for delta, using 0"));
|
||||
@@ -288,7 +288,7 @@ UNREF(testData);
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -304,26 +304,26 @@ float testDataValue = 0.0f;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedBattlefieldMarkerObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getRadius(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_radius.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter radius in template %s", DataResource::getName()));
|
||||
return 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter radius has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter radius has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getRadius();
|
||||
}
|
||||
}
|
||||
@@ -333,9 +333,9 @@ UNREF(testData);
|
||||
if (delta == '+' || delta == '-' || delta == '_' || delta == '=')
|
||||
{
|
||||
float baseValue = 0;
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
if (base != NULL)
|
||||
if (base != nullptr)
|
||||
baseValue = base->getRadius();
|
||||
else if (ms_allowDefaultTemplateParams)
|
||||
DEBUG_WARNING(true, ("No base template for delta, using 0"));
|
||||
@@ -352,7 +352,7 @@ UNREF(testData);
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -368,26 +368,26 @@ float testDataValue = 0.0f;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedBattlefieldMarkerObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getRadiusMin(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_radius.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter radius in template %s", DataResource::getName()));
|
||||
return 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter radius has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter radius has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getRadiusMin();
|
||||
}
|
||||
}
|
||||
@@ -397,9 +397,9 @@ UNREF(testData);
|
||||
if (delta == '+' || delta == '-' || delta == '_' || delta == '=')
|
||||
{
|
||||
float baseValue = 0;
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
if (base != NULL)
|
||||
if (base != nullptr)
|
||||
baseValue = base->getRadiusMin();
|
||||
else if (ms_allowDefaultTemplateParams)
|
||||
DEBUG_WARNING(true, ("No base template for delta, using 0"));
|
||||
@@ -416,7 +416,7 @@ UNREF(testData);
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -432,26 +432,26 @@ float testDataValue = 0.0f;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedBattlefieldMarkerObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedBattlefieldMarkerObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getRadiusMax(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_radius.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter radius in template %s", DataResource::getName()));
|
||||
return 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter radius has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter radius has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getRadiusMax();
|
||||
}
|
||||
}
|
||||
@@ -461,9 +461,9 @@ UNREF(testData);
|
||||
if (delta == '+' || delta == '-' || delta == '_' || delta == '=')
|
||||
{
|
||||
float baseValue = 0;
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
if (base != NULL)
|
||||
if (base != nullptr)
|
||||
baseValue = base->getRadiusMax();
|
||||
else if (ms_allowDefaultTemplateParams)
|
||||
DEBUG_WARNING(true, ("No base template for delta, using 0"));
|
||||
@@ -480,7 +480,7 @@ UNREF(testData);
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -529,12 +529,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+17
-17
@@ -94,10 +94,10 @@ Tag SharedBuildingObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedBuildingObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedBuildingObjectTemplate * base = dynamic_cast<const SharedBuildingObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedBuildingObjectTemplate::getHighestTemplateVersion
|
||||
@@ -111,33 +111,33 @@ std::string testDataValue = DefaultString;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedBuildingObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedBuildingObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedBuildingObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getTerrainModificationFileName(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_terrainModificationFileName.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter terrainModificationFileName in template %s", DataResource::getName()));
|
||||
return DefaultString;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter terrainModificationFileName has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter terrainModificationFileName has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getTerrainModificationFileName();
|
||||
}
|
||||
}
|
||||
|
||||
const std::string & value = m_terrainModificationFileName.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -153,33 +153,33 @@ std::string testDataValue = DefaultString;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedBuildingObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedBuildingObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedBuildingObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getInteriorLayoutFileName(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_interiorLayoutFileName.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter interiorLayoutFileName in template %s", DataResource::getName()));
|
||||
return DefaultString;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter interiorLayoutFileName has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter interiorLayoutFileName has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getInteriorLayoutFileName();
|
||||
}
|
||||
}
|
||||
|
||||
const std::string & value = m_interiorLayoutFileName.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -226,12 +226,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+5
-5
@@ -94,10 +94,10 @@ Tag SharedCellObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedCellObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedCellObjectTemplate * base = dynamic_cast<const SharedCellObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedCellObjectTemplate::getHighestTemplateVersion
|
||||
@@ -140,12 +140,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+5
-5
@@ -94,10 +94,10 @@ Tag SharedConstructionContractObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedConstructionContractObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedConstructionContractObjectTemplate * base = dynamic_cast<const SharedConstructionContractObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedConstructionContractObjectTemplate::getHighestTemplateVersion
|
||||
@@ -140,12 +140,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+387
-387
File diff suppressed because it is too large
Load Diff
+101
-101
@@ -55,7 +55,7 @@ SharedDraftSchematicObjectTemplate::~SharedDraftSchematicObjectTemplate()
|
||||
for (iter = m_slots.begin(); iter != m_slots.end(); ++iter)
|
||||
{
|
||||
delete *iter;
|
||||
*iter = NULL;
|
||||
*iter = nullptr;
|
||||
}
|
||||
m_slots.clear();
|
||||
}
|
||||
@@ -64,7 +64,7 @@ SharedDraftSchematicObjectTemplate::~SharedDraftSchematicObjectTemplate()
|
||||
for (iter = m_attributes.begin(); iter != m_attributes.end(); ++iter)
|
||||
{
|
||||
delete *iter;
|
||||
*iter = NULL;
|
||||
*iter = nullptr;
|
||||
}
|
||||
m_attributes.clear();
|
||||
}
|
||||
@@ -116,10 +116,10 @@ Tag SharedDraftSchematicObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedDraftSchematicObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedDraftSchematicObjectTemplate * base = dynamic_cast<const SharedDraftSchematicObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedDraftSchematicObjectTemplate::getHighestTemplateVersion
|
||||
@@ -127,28 +127,28 @@ Tag SharedDraftSchematicObjectTemplate::getHighestTemplateVersion(void) const
|
||||
//@BEGIN TFD
|
||||
void SharedDraftSchematicObjectTemplate::getSlots(IngredientSlot &data, int index) const
|
||||
{
|
||||
const SharedDraftSchematicObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedDraftSchematicObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate *>(m_baseData);
|
||||
}
|
||||
|
||||
if (!m_slotsLoaded)
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter slots in template %s", DataResource::getName()));
|
||||
return ;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter slots has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter slots has not been defined in template %s!", DataResource::getName()));
|
||||
base->getSlots(data, index);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_slotsAppend && base != NULL)
|
||||
if (m_slotsAppend && base != nullptr)
|
||||
{
|
||||
int baseCount = base->getSlotsCount();
|
||||
if (index < baseCount)
|
||||
@@ -170,28 +170,28 @@ void SharedDraftSchematicObjectTemplate::getSlots(IngredientSlot &data, int inde
|
||||
|
||||
void SharedDraftSchematicObjectTemplate::getSlotsMin(IngredientSlot &data, int index) const
|
||||
{
|
||||
const SharedDraftSchematicObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedDraftSchematicObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate *>(m_baseData);
|
||||
}
|
||||
|
||||
if (!m_slotsLoaded)
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter slots in template %s", DataResource::getName()));
|
||||
return ;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter slots has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter slots has not been defined in template %s!", DataResource::getName()));
|
||||
base->getSlotsMin(data, index);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_slotsAppend && base != NULL)
|
||||
if (m_slotsAppend && base != nullptr)
|
||||
{
|
||||
int baseCount = base->getSlotsCount();
|
||||
if (index < baseCount)
|
||||
@@ -213,28 +213,28 @@ void SharedDraftSchematicObjectTemplate::getSlotsMin(IngredientSlot &data, int i
|
||||
|
||||
void SharedDraftSchematicObjectTemplate::getSlotsMax(IngredientSlot &data, int index) const
|
||||
{
|
||||
const SharedDraftSchematicObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedDraftSchematicObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate *>(m_baseData);
|
||||
}
|
||||
|
||||
if (!m_slotsLoaded)
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter slots in template %s", DataResource::getName()));
|
||||
return ;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter slots has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter slots has not been defined in template %s!", DataResource::getName()));
|
||||
base->getSlotsMax(data, index);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_slotsAppend && base != NULL)
|
||||
if (m_slotsAppend && base != nullptr)
|
||||
{
|
||||
int baseCount = base->getSlotsCount();
|
||||
if (index < baseCount)
|
||||
@@ -258,20 +258,20 @@ size_t SharedDraftSchematicObjectTemplate::getSlotsCount(void) const
|
||||
{
|
||||
if (!m_slotsLoaded)
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return 0;
|
||||
const SharedDraftSchematicObjectTemplate * base = dynamic_cast<const SharedDraftSchematicObjectTemplate *>(m_baseData);
|
||||
DEBUG_FATAL(base == NULL, ("base template wrong type"));
|
||||
DEBUG_FATAL(base == nullptr, ("base template wrong type"));
|
||||
return base->getSlotsCount();
|
||||
}
|
||||
|
||||
size_t count = m_slots.size();
|
||||
|
||||
// if we are extending our base template, add it's count
|
||||
if (m_slotsAppend && m_baseData != NULL)
|
||||
if (m_slotsAppend && m_baseData != nullptr)
|
||||
{
|
||||
const SharedDraftSchematicObjectTemplate * base = dynamic_cast<const SharedDraftSchematicObjectTemplate *>(m_baseData);
|
||||
if (base != NULL)
|
||||
if (base != nullptr)
|
||||
count += base->getSlotsCount();
|
||||
}
|
||||
|
||||
@@ -280,28 +280,28 @@ size_t SharedDraftSchematicObjectTemplate::getSlotsCount(void) const
|
||||
|
||||
void SharedDraftSchematicObjectTemplate::getAttributes(SchematicAttribute &data, int index) const
|
||||
{
|
||||
const SharedDraftSchematicObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedDraftSchematicObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate *>(m_baseData);
|
||||
}
|
||||
|
||||
if (!m_attributesLoaded)
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter attributes in template %s", DataResource::getName()));
|
||||
return ;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter attributes has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter attributes has not been defined in template %s!", DataResource::getName()));
|
||||
base->getAttributes(data, index);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_attributesAppend && base != NULL)
|
||||
if (m_attributesAppend && base != nullptr)
|
||||
{
|
||||
int baseCount = base->getAttributesCount();
|
||||
if (index < baseCount)
|
||||
@@ -324,28 +324,28 @@ void SharedDraftSchematicObjectTemplate::getAttributes(SchematicAttribute &data,
|
||||
|
||||
void SharedDraftSchematicObjectTemplate::getAttributesMin(SchematicAttribute &data, int index) const
|
||||
{
|
||||
const SharedDraftSchematicObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedDraftSchematicObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate *>(m_baseData);
|
||||
}
|
||||
|
||||
if (!m_attributesLoaded)
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter attributes in template %s", DataResource::getName()));
|
||||
return ;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter attributes has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter attributes has not been defined in template %s!", DataResource::getName()));
|
||||
base->getAttributesMin(data, index);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_attributesAppend && base != NULL)
|
||||
if (m_attributesAppend && base != nullptr)
|
||||
{
|
||||
int baseCount = base->getAttributesCount();
|
||||
if (index < baseCount)
|
||||
@@ -368,28 +368,28 @@ void SharedDraftSchematicObjectTemplate::getAttributesMin(SchematicAttribute &da
|
||||
|
||||
void SharedDraftSchematicObjectTemplate::getAttributesMax(SchematicAttribute &data, int index) const
|
||||
{
|
||||
const SharedDraftSchematicObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedDraftSchematicObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate *>(m_baseData);
|
||||
}
|
||||
|
||||
if (!m_attributesLoaded)
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter attributes in template %s", DataResource::getName()));
|
||||
return ;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter attributes has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter attributes has not been defined in template %s!", DataResource::getName()));
|
||||
base->getAttributesMax(data, index);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_attributesAppend && base != NULL)
|
||||
if (m_attributesAppend && base != nullptr)
|
||||
{
|
||||
int baseCount = base->getAttributesCount();
|
||||
if (index < baseCount)
|
||||
@@ -414,20 +414,20 @@ size_t SharedDraftSchematicObjectTemplate::getAttributesCount(void) const
|
||||
{
|
||||
if (!m_attributesLoaded)
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return 0;
|
||||
const SharedDraftSchematicObjectTemplate * base = dynamic_cast<const SharedDraftSchematicObjectTemplate *>(m_baseData);
|
||||
DEBUG_FATAL(base == NULL, ("base template wrong type"));
|
||||
DEBUG_FATAL(base == nullptr, ("base template wrong type"));
|
||||
return base->getAttributesCount();
|
||||
}
|
||||
|
||||
size_t count = m_attributes.size();
|
||||
|
||||
// if we are extending our base template, add it's count
|
||||
if (m_attributesAppend && m_baseData != NULL)
|
||||
if (m_attributesAppend && m_baseData != nullptr)
|
||||
{
|
||||
const SharedDraftSchematicObjectTemplate * base = dynamic_cast<const SharedDraftSchematicObjectTemplate *>(m_baseData);
|
||||
if (base != NULL)
|
||||
if (base != nullptr)
|
||||
count += base->getAttributesCount();
|
||||
}
|
||||
|
||||
@@ -442,33 +442,33 @@ std::string testDataValue = DefaultString;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedDraftSchematicObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedDraftSchematicObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getCraftedSharedTemplate(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_craftedSharedTemplate.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter craftedSharedTemplate in template %s", DataResource::getName()));
|
||||
return DefaultString;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter craftedSharedTemplate has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter craftedSharedTemplate has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getCraftedSharedTemplate();
|
||||
}
|
||||
}
|
||||
|
||||
const std::string & value = m_craftedSharedTemplate.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -514,12 +514,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
@@ -548,7 +548,7 @@ char paramName[MAX_NAME_SIZE];
|
||||
for (iter = m_slots.begin(); iter != m_slots.end(); ++iter)
|
||||
{
|
||||
delete *iter;
|
||||
*iter = NULL;
|
||||
*iter = nullptr;
|
||||
}
|
||||
m_slots.clear();
|
||||
m_slotsAppend = file.read_bool8();
|
||||
@@ -567,7 +567,7 @@ char paramName[MAX_NAME_SIZE];
|
||||
for (iter = m_attributes.begin(); iter != m_attributes.end(); ++iter)
|
||||
{
|
||||
delete *iter;
|
||||
*iter = NULL;
|
||||
*iter = nullptr;
|
||||
}
|
||||
m_attributes.clear();
|
||||
m_attributesAppend = file.read_bool8();
|
||||
@@ -646,33 +646,33 @@ StringId testDataValue = DefaultStringId;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedDraftSchematicObjectTemplate::_IngredientSlot * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedDraftSchematicObjectTemplate::_IngredientSlot * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate::_IngredientSlot *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getName(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_name.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter name in template %s", DataResource::getName()));
|
||||
return DefaultStringId;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter name has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter name has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getName(versionOk);
|
||||
}
|
||||
}
|
||||
|
||||
const StringId value = m_name.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -688,33 +688,33 @@ std::string testDataValue = DefaultString;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedDraftSchematicObjectTemplate::_IngredientSlot * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedDraftSchematicObjectTemplate::_IngredientSlot * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate::_IngredientSlot *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getHardpoint(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_hardpoint.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter hardpoint in template %s", DataResource::getName()));
|
||||
return DefaultString;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter hardpoint has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter hardpoint has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getHardpoint(versionOk);
|
||||
}
|
||||
}
|
||||
|
||||
const std::string & value = m_hardpoint.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -819,33 +819,33 @@ StringId testDataValue = DefaultStringId;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedDraftSchematicObjectTemplate::_SchematicAttribute * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedDraftSchematicObjectTemplate::_SchematicAttribute * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate::_SchematicAttribute *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getName(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_name.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter name in template %s", DataResource::getName()));
|
||||
return DefaultStringId;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter name has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter name has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getName(versionOk);
|
||||
}
|
||||
}
|
||||
|
||||
const StringId value = m_name.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -861,33 +861,33 @@ StringId testDataValue = DefaultStringId;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedDraftSchematicObjectTemplate::_SchematicAttribute * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedDraftSchematicObjectTemplate::_SchematicAttribute * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate::_SchematicAttribute *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getExperiment(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_experiment.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter experiment in template %s", DataResource::getName()));
|
||||
return DefaultStringId;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter experiment has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter experiment has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getExperiment(versionOk);
|
||||
}
|
||||
}
|
||||
|
||||
const StringId value = m_experiment.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -903,26 +903,26 @@ int testDataValue = 0;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedDraftSchematicObjectTemplate::_SchematicAttribute * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedDraftSchematicObjectTemplate::_SchematicAttribute * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate::_SchematicAttribute *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getValue(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_value.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter value in template %s", DataResource::getName()));
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter value has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter value has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getValue(versionOk);
|
||||
}
|
||||
}
|
||||
@@ -932,9 +932,9 @@ UNREF(testData);
|
||||
if (delta == '+' || delta == '-' || delta == '_' || delta == '=')
|
||||
{
|
||||
int baseValue = 0;
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
if (base != NULL)
|
||||
if (base != nullptr)
|
||||
baseValue = base->getValue(versionOk);
|
||||
else if (ms_allowDefaultTemplateParams)
|
||||
DEBUG_WARNING(true, ("No base template for delta, using 0"));
|
||||
@@ -951,7 +951,7 @@ UNREF(testData);
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -967,26 +967,26 @@ int testDataValue = 0;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedDraftSchematicObjectTemplate::_SchematicAttribute * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedDraftSchematicObjectTemplate::_SchematicAttribute * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate::_SchematicAttribute *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getValueMin(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_value.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter value in template %s", DataResource::getName()));
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter value has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter value has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getValueMin(versionOk);
|
||||
}
|
||||
}
|
||||
@@ -996,9 +996,9 @@ UNREF(testData);
|
||||
if (delta == '+' || delta == '-' || delta == '_' || delta == '=')
|
||||
{
|
||||
int baseValue = 0;
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
if (base != NULL)
|
||||
if (base != nullptr)
|
||||
baseValue = base->getValueMin(versionOk);
|
||||
else if (ms_allowDefaultTemplateParams)
|
||||
DEBUG_WARNING(true, ("No base template for delta, using 0"));
|
||||
@@ -1015,7 +1015,7 @@ UNREF(testData);
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -1031,26 +1031,26 @@ int testDataValue = 0;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedDraftSchematicObjectTemplate::_SchematicAttribute * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedDraftSchematicObjectTemplate::_SchematicAttribute * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedDraftSchematicObjectTemplate::_SchematicAttribute *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getValueMax(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_value.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter value in template %s", DataResource::getName()));
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter value has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter value has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getValueMax(versionOk);
|
||||
}
|
||||
}
|
||||
@@ -1060,9 +1060,9 @@ UNREF(testData);
|
||||
if (delta == '+' || delta == '-' || delta == '_' || delta == '=')
|
||||
{
|
||||
int baseValue = 0;
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
if (base != NULL)
|
||||
if (base != nullptr)
|
||||
baseValue = base->getValueMax(versionOk);
|
||||
else if (ms_allowDefaultTemplateParams)
|
||||
DEBUG_WARNING(true, ("No base template for delta, using 0"));
|
||||
@@ -1079,7 +1079,7 @@ UNREF(testData);
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
+5
-5
@@ -94,10 +94,10 @@ Tag SharedFactoryObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedFactoryObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedFactoryObjectTemplate * base = dynamic_cast<const SharedFactoryObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedFactoryObjectTemplate::getHighestTemplateVersion
|
||||
@@ -140,12 +140,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+5
-5
@@ -94,10 +94,10 @@ Tag SharedGroupObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedGroupObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedGroupObjectTemplate * base = dynamic_cast<const SharedGroupObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedGroupObjectTemplate::getHighestTemplateVersion
|
||||
@@ -140,12 +140,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+5
-5
@@ -94,10 +94,10 @@ Tag SharedGuildObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedGuildObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedGuildObjectTemplate * base = dynamic_cast<const SharedGuildObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedGuildObjectTemplate::getHighestTemplateVersion
|
||||
@@ -140,12 +140,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+5
-5
@@ -94,10 +94,10 @@ Tag SharedInstallationObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedInstallationObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedInstallationObjectTemplate * base = dynamic_cast<const SharedInstallationObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedInstallationObjectTemplate::getHighestTemplateVersion
|
||||
@@ -140,12 +140,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+5
-5
@@ -94,10 +94,10 @@ Tag SharedIntangibleObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedIntangibleObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedIntangibleObjectTemplate * base = dynamic_cast<const SharedIntangibleObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedIntangibleObjectTemplate::getHighestTemplateVersion
|
||||
@@ -140,12 +140,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+5
-5
@@ -95,10 +95,10 @@ Tag SharedJediManagerObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedJediManagerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedJediManagerObjectTemplate * base = dynamic_cast<const SharedJediManagerObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedJediManagerObjectTemplate::getHighestTemplateVersion
|
||||
@@ -141,12 +141,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+5
-5
@@ -94,10 +94,10 @@ Tag SharedManufactureSchematicObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedManufactureSchematicObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedManufactureSchematicObjectTemplate * base = dynamic_cast<const SharedManufactureSchematicObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedManufactureSchematicObjectTemplate::getHighestTemplateVersion
|
||||
@@ -140,12 +140,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+5
-5
@@ -94,10 +94,10 @@ Tag SharedMissionObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedMissionObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedMissionObjectTemplate * base = dynamic_cast<const SharedMissionObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedMissionObjectTemplate::getHighestTemplateVersion
|
||||
@@ -140,12 +140,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+247
-247
File diff suppressed because it is too large
Load Diff
+5
-5
@@ -95,10 +95,10 @@ Tag SharedPlayerObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedPlayerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedPlayerObjectTemplate * base = dynamic_cast<const SharedPlayerObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedPlayerObjectTemplate::getHighestTemplateVersion
|
||||
@@ -141,12 +141,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+5
-5
@@ -95,10 +95,10 @@ Tag SharedPlayerQuestObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedPlayerQuestObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedPlayerQuestObjectTemplate * base = dynamic_cast<const SharedPlayerQuestObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedPlayerQuestObjectTemplate::getHighestTemplateVersion
|
||||
@@ -141,12 +141,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+5
-5
@@ -94,10 +94,10 @@ Tag SharedResourceContainerObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedResourceContainerObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedResourceContainerObjectTemplate * base = dynamic_cast<const SharedResourceContainerObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedResourceContainerObjectTemplate::getHighestTemplateVersion
|
||||
@@ -140,12 +140,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+29
-29
@@ -101,10 +101,10 @@ Tag SharedShipObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedShipObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedShipObjectTemplate * base = dynamic_cast<const SharedShipObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedShipObjectTemplate::getHighestTemplateVersion
|
||||
@@ -155,33 +155,33 @@ std::string testDataValue = DefaultString;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedShipObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedShipObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedShipObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getCockpitFilename(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_cockpitFilename.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter cockpitFilename in template %s", DataResource::getName()));
|
||||
return DefaultString;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter cockpitFilename has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter cockpitFilename has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getCockpitFilename();
|
||||
}
|
||||
}
|
||||
|
||||
const std::string & value = m_cockpitFilename.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -197,33 +197,33 @@ bool testDataValue = false;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedShipObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedShipObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedShipObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getHasWings(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_hasWings.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter hasWings in template %s", DataResource::getName()));
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter hasWings has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter hasWings has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getHasWings();
|
||||
}
|
||||
}
|
||||
|
||||
bool value = m_hasWings.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -239,33 +239,33 @@ bool testDataValue = false;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedShipObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedShipObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedShipObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getPlayerControlled(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_playerControlled.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter playerControlled in template %s", DataResource::getName()));
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter playerControlled has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter playerControlled has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getPlayerControlled();
|
||||
}
|
||||
}
|
||||
|
||||
bool value = m_playerControlled.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -281,33 +281,33 @@ std::string testDataValue = DefaultString;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedShipObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedShipObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedShipObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getInteriorLayoutFileName(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_interiorLayoutFileName.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter interiorLayoutFileName in template %s", DataResource::getName()));
|
||||
return DefaultString;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter interiorLayoutFileName has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter interiorLayoutFileName has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getInteriorLayoutFileName();
|
||||
}
|
||||
}
|
||||
|
||||
const std::string & value = m_interiorLayoutFileName.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -356,12 +356,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+5
-5
@@ -94,10 +94,10 @@ Tag SharedStaticObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedStaticObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedStaticObjectTemplate * base = dynamic_cast<const SharedStaticObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedStaticObjectTemplate::getHighestTemplateVersion
|
||||
@@ -140,12 +140,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+273
-273
File diff suppressed because it is too large
Load Diff
+35
-35
@@ -94,10 +94,10 @@ Tag SharedTerrainSurfaceObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedTerrainSurfaceObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedTerrainSurfaceObjectTemplate * base = dynamic_cast<const SharedTerrainSurfaceObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedTerrainSurfaceObjectTemplate::getHighestTemplateVersion
|
||||
@@ -111,26 +111,26 @@ float testDataValue = 0.0f;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedTerrainSurfaceObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedTerrainSurfaceObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedTerrainSurfaceObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getCover(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_cover.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter cover in template %s", DataResource::getName()));
|
||||
return 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter cover has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter cover has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getCover();
|
||||
}
|
||||
}
|
||||
@@ -140,9 +140,9 @@ UNREF(testData);
|
||||
if (delta == '+' || delta == '-' || delta == '_' || delta == '=')
|
||||
{
|
||||
float baseValue = 0;
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
if (base != NULL)
|
||||
if (base != nullptr)
|
||||
baseValue = base->getCover();
|
||||
else if (ms_allowDefaultTemplateParams)
|
||||
DEBUG_WARNING(true, ("No base template for delta, using 0"));
|
||||
@@ -159,7 +159,7 @@ UNREF(testData);
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
if (testDataValue == value)
|
||||
DEBUG_WARNING(true, ("Template %s, parameter cover is returning same value as base template.", DataResource::getName()));
|
||||
@@ -177,26 +177,26 @@ float testDataValue = 0.0f;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedTerrainSurfaceObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedTerrainSurfaceObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedTerrainSurfaceObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getCoverMin(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_cover.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter cover in template %s", DataResource::getName()));
|
||||
return 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter cover has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter cover has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getCoverMin();
|
||||
}
|
||||
}
|
||||
@@ -206,9 +206,9 @@ UNREF(testData);
|
||||
if (delta == '+' || delta == '-' || delta == '_' || delta == '=')
|
||||
{
|
||||
float baseValue = 0;
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
if (base != NULL)
|
||||
if (base != nullptr)
|
||||
baseValue = base->getCoverMin();
|
||||
else if (ms_allowDefaultTemplateParams)
|
||||
DEBUG_WARNING(true, ("No base template for delta, using 0"));
|
||||
@@ -225,7 +225,7 @@ UNREF(testData);
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
if (testDataValue == value)
|
||||
DEBUG_WARNING(true, ("Template %s, parameter cover is returning same value as base template.", DataResource::getName()));
|
||||
@@ -243,26 +243,26 @@ float testDataValue = 0.0f;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedTerrainSurfaceObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedTerrainSurfaceObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedTerrainSurfaceObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getCoverMax(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_cover.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter cover in template %s", DataResource::getName()));
|
||||
return 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter cover has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter cover has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getCoverMax();
|
||||
}
|
||||
}
|
||||
@@ -272,9 +272,9 @@ UNREF(testData);
|
||||
if (delta == '+' || delta == '-' || delta == '_' || delta == '=')
|
||||
{
|
||||
float baseValue = 0;
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
if (base != NULL)
|
||||
if (base != nullptr)
|
||||
baseValue = base->getCoverMax();
|
||||
else if (ms_allowDefaultTemplateParams)
|
||||
DEBUG_WARNING(true, ("No base template for delta, using 0"));
|
||||
@@ -291,7 +291,7 @@ UNREF(testData);
|
||||
value = baseValue - static_cast<float>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
if (testDataValue == value)
|
||||
DEBUG_WARNING(true, ("Template %s, parameter cover is returning same value as base template.", DataResource::getName()));
|
||||
@@ -309,33 +309,33 @@ std::string testDataValue = DefaultString;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedTerrainSurfaceObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedTerrainSurfaceObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedTerrainSurfaceObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getSurfaceType(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_surfaceType.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter surfaceType in template %s", DataResource::getName()));
|
||||
return DefaultString;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter surfaceType has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter surfaceType has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getSurfaceType();
|
||||
}
|
||||
}
|
||||
|
||||
const std::string & value = m_surfaceType.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
if (testDataValue == value)
|
||||
DEBUG_WARNING(true, ("Template %s, parameter surfaceType is returning same value as base template.", DataResource::getName()));
|
||||
@@ -383,12 +383,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+5
-5
@@ -95,10 +95,10 @@ Tag SharedUniverseObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedUniverseObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedUniverseObjectTemplate * base = dynamic_cast<const SharedUniverseObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedUniverseObjectTemplate::getHighestTemplateVersion
|
||||
@@ -141,12 +141,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+167
-167
File diff suppressed because it is too large
Load Diff
+5
-5
@@ -94,10 +94,10 @@ Tag SharedWaypointObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedWaypointObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedWaypointObjectTemplate * base = dynamic_cast<const SharedWaypointObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedWaypointObjectTemplate::getHighestTemplateVersion
|
||||
@@ -140,12 +140,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
+41
-41
@@ -94,10 +94,10 @@ Tag SharedWeaponObjectTemplate::getTemplateVersion(void) const
|
||||
*/
|
||||
Tag SharedWeaponObjectTemplate::getHighestTemplateVersion(void) const
|
||||
{
|
||||
if (m_baseData == NULL)
|
||||
if (m_baseData == nullptr)
|
||||
return m_templateVersion;
|
||||
const SharedWeaponObjectTemplate * base = dynamic_cast<const SharedWeaponObjectTemplate *>(m_baseData);
|
||||
if (base == NULL)
|
||||
if (base == nullptr)
|
||||
return m_templateVersion;
|
||||
return std::max(m_templateVersion, base->getHighestTemplateVersion());
|
||||
} // SharedWeaponObjectTemplate::getHighestTemplateVersion
|
||||
@@ -111,33 +111,33 @@ std::string testDataValue = DefaultString;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedWeaponObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedWeaponObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedWeaponObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getWeaponEffect(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_weaponEffect.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter weaponEffect in template %s", DataResource::getName()));
|
||||
return DefaultString;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter weaponEffect has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter weaponEffect has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getWeaponEffect();
|
||||
}
|
||||
}
|
||||
|
||||
const std::string & value = m_weaponEffect.getValue();
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -153,26 +153,26 @@ int testDataValue = 0;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedWeaponObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedWeaponObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedWeaponObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getWeaponEffectIndex(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_weaponEffectIndex.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter weaponEffectIndex in template %s", DataResource::getName()));
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter weaponEffectIndex has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter weaponEffectIndex has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getWeaponEffectIndex();
|
||||
}
|
||||
}
|
||||
@@ -182,9 +182,9 @@ UNREF(testData);
|
||||
if (delta == '+' || delta == '-' || delta == '_' || delta == '=')
|
||||
{
|
||||
int baseValue = 0;
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
if (base != NULL)
|
||||
if (base != nullptr)
|
||||
baseValue = base->getWeaponEffectIndex();
|
||||
else if (ms_allowDefaultTemplateParams)
|
||||
DEBUG_WARNING(true, ("No base template for delta, using 0"));
|
||||
@@ -201,7 +201,7 @@ UNREF(testData);
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -217,26 +217,26 @@ int testDataValue = 0;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedWeaponObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedWeaponObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedWeaponObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getWeaponEffectIndexMin(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_weaponEffectIndex.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter weaponEffectIndex in template %s", DataResource::getName()));
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter weaponEffectIndex has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter weaponEffectIndex has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getWeaponEffectIndexMin();
|
||||
}
|
||||
}
|
||||
@@ -246,9 +246,9 @@ UNREF(testData);
|
||||
if (delta == '+' || delta == '-' || delta == '_' || delta == '=')
|
||||
{
|
||||
int baseValue = 0;
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
if (base != NULL)
|
||||
if (base != nullptr)
|
||||
baseValue = base->getWeaponEffectIndexMin();
|
||||
else if (ms_allowDefaultTemplateParams)
|
||||
DEBUG_WARNING(true, ("No base template for delta, using 0"));
|
||||
@@ -265,7 +265,7 @@ UNREF(testData);
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -281,26 +281,26 @@ int testDataValue = 0;
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedWeaponObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedWeaponObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedWeaponObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getWeaponEffectIndexMax(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_weaponEffectIndex.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter weaponEffectIndex in template %s", DataResource::getName()));
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter weaponEffectIndex has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter weaponEffectIndex has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getWeaponEffectIndexMax();
|
||||
}
|
||||
}
|
||||
@@ -310,9 +310,9 @@ UNREF(testData);
|
||||
if (delta == '+' || delta == '-' || delta == '_' || delta == '=')
|
||||
{
|
||||
int baseValue = 0;
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
if (base != NULL)
|
||||
if (base != nullptr)
|
||||
baseValue = base->getWeaponEffectIndexMax();
|
||||
else if (ms_allowDefaultTemplateParams)
|
||||
DEBUG_WARNING(true, ("No base template for delta, using 0"));
|
||||
@@ -329,7 +329,7 @@ UNREF(testData);
|
||||
value = baseValue - static_cast<int>(baseValue * (value / 100.0f));
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -345,33 +345,33 @@ SharedWeaponObjectTemplate::AttackType testDataValue = static_cast<SharedWeaponO
|
||||
UNREF(testData);
|
||||
#endif
|
||||
|
||||
const SharedWeaponObjectTemplate * base = NULL;
|
||||
if (m_baseData != NULL)
|
||||
const SharedWeaponObjectTemplate * base = nullptr;
|
||||
if (m_baseData != nullptr)
|
||||
{
|
||||
base = dynamic_cast<const SharedWeaponObjectTemplate *>(m_baseData);
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
testDataValue = base->getAttackType(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_attackType.isLoaded())
|
||||
{
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
|
||||
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Returning default value for missing parameter attackType in template %s", DataResource::getName()));
|
||||
return static_cast<AttackType>(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FATAL(base == NULL, ("Template parameter attackType has not been defined in template %s!", DataResource::getName()));
|
||||
DEBUG_FATAL(base == nullptr, ("Template parameter attackType has not been defined in template %s!", DataResource::getName()));
|
||||
return base->getAttackType();
|
||||
}
|
||||
}
|
||||
|
||||
AttackType value = static_cast<AttackType>(m_attackType.getValue());
|
||||
#ifdef _DEBUG
|
||||
if (testData && base != NULL)
|
||||
if (testData && base != nullptr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -420,12 +420,12 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.read_string(baseFilename);
|
||||
file.exitChunk();
|
||||
const ObjectTemplate *base = ObjectTemplateList::fetch(baseFilename);
|
||||
DEBUG_WARNING(base == NULL, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != NULL)
|
||||
DEBUG_WARNING(base == nullptr, ("was unable to load base template %s", baseFilename.c_str()));
|
||||
if (m_baseData == base && base != nullptr)
|
||||
base->releaseReference();
|
||||
else
|
||||
{
|
||||
if (m_baseData != NULL)
|
||||
if (m_baseData != nullptr)
|
||||
m_baseData->releaseReference();
|
||||
m_baseData = base;
|
||||
}
|
||||
|
||||
@@ -358,7 +358,7 @@ int Quest::getNumberOfTasks() const
|
||||
QuestTask const * Quest::getTask(int const taskId) const
|
||||
{
|
||||
if (taskId < 0 || taskId >= getNumberOfTasks())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return (*m_tasks)[static_cast<size_t>(taskId)];
|
||||
}
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ void QuestManager::remove()
|
||||
Quest const * QuestManager::getQuest(CrcString const & fileName)
|
||||
{
|
||||
Quest const * const quest = getQuest(fileName.getCrc());
|
||||
DEBUG_WARNING(quest == NULL, ("QuestManager::getQuest(%s): FAILED - testquest not found", fileName.getString()));
|
||||
DEBUG_WARNING(quest == nullptr, ("QuestManager::getQuest(%s): FAILED - testquest not found", fileName.getString()));
|
||||
return quest;
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ Quest const * QuestManager::getQuest(CrcString const & fileName)
|
||||
|
||||
Quest const * QuestManager::getQuest(uint32 const questCrc)
|
||||
{
|
||||
Quest * quest = NULL;
|
||||
Quest * quest = nullptr;
|
||||
|
||||
//-- Look for the quest in the quest map
|
||||
QuestMap::iterator const iter = s_quests.find(questCrc);
|
||||
@@ -223,7 +223,7 @@ Quest const * QuestManager::getQuest(uint32 const questCrc)
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_WARNING(quest == NULL, ("QuestManager::getQuest: FAILED - testquest not found"));
|
||||
DEBUG_WARNING(quest == nullptr, ("QuestManager::getQuest: FAILED - testquest not found"));
|
||||
|
||||
return quest;
|
||||
}
|
||||
@@ -234,7 +234,7 @@ Quest const * QuestManager::getQuest(std::string const & questName)
|
||||
{
|
||||
TemporaryCrcString const fileName(questName.c_str(), true);
|
||||
Quest const * const quest = getQuest(fileName);
|
||||
DEBUG_WARNING(quest == NULL, ("QuestManager::getQuest(%s): FAILED - testquest not found", questName.c_str()));
|
||||
DEBUG_WARNING(quest == nullptr, ("QuestManager::getQuest(%s): FAILED - testquest not found", questName.c_str()));
|
||||
return quest;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ void AsteroidGenerationManager::install()
|
||||
DEBUG_FATAL(s_installed, ("AsteroidGenerationManager already installed"));
|
||||
s_installed = true;
|
||||
|
||||
ms_getRadiusFunction = NULL;
|
||||
ms_getRadiusFunction = nullptr;
|
||||
|
||||
ExitChain::add(AsteroidGenerationManager::remove, "AsteroidGenerationManager::remove");
|
||||
}
|
||||
@@ -88,7 +88,7 @@ void AsteroidGenerationManager::install()
|
||||
|
||||
void AsteroidGenerationManager::remove()
|
||||
{
|
||||
ms_getRadiusFunction = NULL;
|
||||
ms_getRadiusFunction = nullptr;
|
||||
|
||||
clearStaticFieldData();
|
||||
clearInstantiatedData();
|
||||
@@ -381,7 +381,7 @@ bool AsteroidGenerationManager::generateField(AsteroidFieldData const & fieldDat
|
||||
|
||||
s_randomGenerator.setSeed(fieldData.seed);
|
||||
|
||||
WaveForm3D * splineWaveform = NULL;
|
||||
WaveForm3D * splineWaveform = nullptr;
|
||||
if (fieldData.fieldType == AsteroidFieldData::FT_spline)
|
||||
{
|
||||
splineWaveform = new WaveForm3D;
|
||||
@@ -403,7 +403,7 @@ bool AsteroidGenerationManager::generateField(AsteroidFieldData const & fieldDat
|
||||
{
|
||||
bool valid = false;
|
||||
std::vector<Sphere*> collisionResult;
|
||||
Sphere * s = NULL;
|
||||
Sphere * s = nullptr;
|
||||
while(!valid)
|
||||
{
|
||||
//create asteroid locations until we find one that doesn't penetrate any existing objects
|
||||
@@ -444,11 +444,11 @@ bool AsteroidGenerationManager::generateField(AsteroidFieldData const & fieldDat
|
||||
{
|
||||
DEBUG_REPORT_LOG_PRINT(ConfigSharedGame::getSpamAsteroidGenerationData(), ("Asteroid creation collision at [%f, %f, %f], radius [%f], trying again...\n", newAsteroid.position.x, newAsteroid.position.y, newAsteroid.position.z, s->getRadius()));
|
||||
delete s;
|
||||
s = NULL;
|
||||
s = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
NOT_NULL(s); //lint !e644 // s could be uninitialized (not true -- initialized to NULL above, should be set to a value during the while loop)
|
||||
NOT_NULL(s); //lint !e644 // s could be uninitialized (not true -- initialized to nullptr above, should be set to a value during the while loop)
|
||||
|
||||
SpatialSubdivisionHandle* handle = ms_collisionSphereTree.addObject(s);
|
||||
if(handle)
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace NebulaManagerNamespace
|
||||
};
|
||||
|
||||
typedef SphereTree<Nebula const *, NebulaSphereAccessor> NebulaSphereTree;
|
||||
NebulaSphereTree * s_collisionSphereTree = NULL;
|
||||
NebulaSphereTree * s_collisionSphereTree = nullptr;
|
||||
|
||||
enum DatatableColumns
|
||||
{
|
||||
@@ -110,7 +110,7 @@ namespace NebulaManagerNamespace
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
NebulaManager::ImplementationClearFunction s_clearFunction = NULL;
|
||||
NebulaManager::ImplementationClearFunction s_clearFunction = nullptr;
|
||||
}
|
||||
|
||||
using namespace NebulaManagerNamespace;
|
||||
@@ -158,10 +158,10 @@ void NebulaManager::clear()
|
||||
|
||||
s_nebulaMap.clear();
|
||||
|
||||
if (s_collisionSphereTree != NULL)
|
||||
if (s_collisionSphereTree != nullptr)
|
||||
{
|
||||
delete s_collisionSphereTree;
|
||||
s_collisionSphereTree = NULL;
|
||||
s_collisionSphereTree = nullptr;
|
||||
}
|
||||
|
||||
//-- Remove nebulas for the current scene from the scene map
|
||||
@@ -178,7 +178,7 @@ void NebulaManager::clear()
|
||||
|
||||
s_currentSceneId.clear();
|
||||
|
||||
if (s_clearFunction != NULL)
|
||||
if (s_clearFunction != nullptr)
|
||||
s_clearFunction();
|
||||
}
|
||||
|
||||
@@ -319,11 +319,11 @@ void NebulaManager::getNebulasInSphere(Vector const & pos, float const radius, N
|
||||
|
||||
Nebula const * NebulaManager::getClosestNebula(Vector const & pos, float const maxDistance, float & outMinDistance, float & outMaxDistance)
|
||||
{
|
||||
Nebula const * nebula = NULL;
|
||||
Nebula const * nebula = nullptr;
|
||||
if (NON_NULL(s_collisionSphereTree)->findClosest(pos, maxDistance, nebula, outMinDistance, outMaxDistance))
|
||||
return nebula;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -334,7 +334,7 @@ Nebula const * NebulaManager::getNebulaById(int const id)
|
||||
if (it != s_nebulaMap.end())
|
||||
return (*it).second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@@ -211,7 +211,7 @@ bool ShipChassis::save(std::string const & filename)
|
||||
|
||||
ShipChassisSlot const * const chassisSlot = shipChassis->getSlot(static_cast<ShipChassisSlotType::Type>(chassisSlotType));
|
||||
|
||||
if (NULL == chassisSlot)
|
||||
if (nullptr == chassisSlot)
|
||||
{
|
||||
tabStr += "\t\t";
|
||||
continue;
|
||||
@@ -249,7 +249,7 @@ bool ShipChassis::save(std::string const & filename)
|
||||
|
||||
StdioFileFactory sff;
|
||||
AbstractFile * const af = sff.createFile(filename.c_str(), "wb");
|
||||
if (NULL != af && af->isOpen())
|
||||
if (nullptr != af && af->isOpen())
|
||||
{
|
||||
int const bytesWritten = af->write(static_cast<int>(tabStr.size()), tabStr.c_str());
|
||||
retval = (bytesWritten == static_cast<int>(tabStr.size()));
|
||||
@@ -317,7 +317,7 @@ ShipChassis const * ShipChassis::findShipChassisByName (CrcString const &
|
||||
if (it != s_nameChassisMap->end ())
|
||||
return (*it).second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -330,7 +330,7 @@ ShipChassis const * ShipChassis::findShipChassisByCrc (uint32 chassis
|
||||
if (it != s_crcChassisMap.end ())
|
||||
return (*it).second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -365,7 +365,7 @@ void ShipChassis::setSlotTargetable(int const chassisSlotType, bool targetable)
|
||||
{
|
||||
if (targetable)
|
||||
{
|
||||
if (NULL == getSlot(static_cast<ShipChassisSlotType::Type>(chassisSlotType)))
|
||||
if (nullptr == getSlot(static_cast<ShipChassisSlotType::Type>(chassisSlotType)))
|
||||
{
|
||||
WARNING(true, ("ShipChassis cannot set non existant slot [%d] targetable", chassisSlotType));
|
||||
return;
|
||||
@@ -398,7 +398,7 @@ ShipChassisSlot * ShipChassis::getSlot(ShipChassisSlotType::Type shipChassisSlot
|
||||
return &slot;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -582,7 +582,7 @@ void ShipChassis::setUseWritableChassis(bool onlyUseThisForTools)
|
||||
|
||||
bool ShipChassis::addChassis(bool doSort)
|
||||
{
|
||||
if (doSort && NULL != findShipChassisByCrc(getCrc()))
|
||||
if (doSort && nullptr != findShipChassisByCrc(getCrc()))
|
||||
{
|
||||
WARNING(true, ("ShipChassis attempt to add multiple [%s] chassis", getName().getString()));
|
||||
return false;
|
||||
@@ -628,7 +628,7 @@ bool ShipChassis::removeChassis()
|
||||
bool ShipChassis::setName(CrcString const & name)
|
||||
{
|
||||
ShipChassis const * const dupeNameShipChassis = findShipChassisByName(name);
|
||||
if (NULL != dupeNameShipChassis)
|
||||
if (nullptr != dupeNameShipChassis)
|
||||
{
|
||||
WARNING(true, ("ShipChassis attempt to set name [%s] already exists", name.getString()));
|
||||
return false;
|
||||
|
||||
@@ -78,7 +78,7 @@ ShipChassisSlot::~ShipChassisSlot ()
|
||||
std::for_each(m_compatibilities->begin(), m_compatibilities->end(), PointerDeleter());
|
||||
m_compatibilities->clear();
|
||||
delete m_compatibilities;
|
||||
m_compatibilities = NULL;
|
||||
m_compatibilities = nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -145,7 +145,7 @@ bool ShipChassisSlot::canAcceptComponentType (int shipComponentType) const
|
||||
|
||||
bool ShipChassisSlot::canAcceptCompatibility (CrcString const & compatibility) const
|
||||
{
|
||||
//-- null compatibility components are universally accepted
|
||||
//-- nullptr compatibility components are universally accepted
|
||||
if (compatibility.isEmpty ())
|
||||
return true;
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ bool ShipChassisWritable::setName(CrcString const & name)
|
||||
{
|
||||
if (ShipChassis::setName(name))
|
||||
{
|
||||
if (NULL != findShipChassisByCrc(name.getCrc()))
|
||||
if (nullptr != findShipChassisByCrc(name.getCrc()))
|
||||
Transceivers::chassisListChanged.emitMessage(true);
|
||||
return true;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ void ShipChassisWritable::setSlotTargetable(int chassisSlotType, bool targetable
|
||||
{
|
||||
ShipChassisSlot * const chassisSlot = getSlot(static_cast<ShipChassisSlotType::Type>(chassisSlotType));
|
||||
|
||||
if (NULL == chassisSlot)
|
||||
if (nullptr == chassisSlot)
|
||||
{
|
||||
WARNING(true, ("ShipChassisWritable::setSlotTargetable() invalid slot"));
|
||||
}
|
||||
|
||||
+7
-7
@@ -164,7 +164,7 @@ void ShipComponentAttachmentManager::load()
|
||||
ShipComponentDescriptor const * const shipComponentDescriptor =
|
||||
ShipComponentDescriptor::findShipComponentDescriptorByName (TemporaryCrcString (componentName.c_str (), true));
|
||||
|
||||
if (shipComponentDescriptor == NULL)
|
||||
if (shipComponentDescriptor == nullptr)
|
||||
{
|
||||
WARNING (true, ("ShipComponentAttachmentManager chassis [%s] specified invalid component [%s] at row [%d] in file [%s]", name.getString (), componentName.c_str (), row, chassis_filename.c_str()));
|
||||
continue;
|
||||
@@ -266,7 +266,7 @@ bool ShipComponentAttachmentManager::save(std::string const & dsrcPath, std::str
|
||||
bool ShipComponentAttachmentManager::saveChassisInfo(std::string const & chassisName, std::string const & filenameTab, std::string const & filenameIff)
|
||||
{
|
||||
ShipChassis const * const chassis = ShipChassis::findShipChassisByName(ConstCharCrcString(chassisName.c_str()));
|
||||
if (NULL == chassis)
|
||||
if (nullptr == chassis)
|
||||
return false;
|
||||
|
||||
uint32 const chassisCrc = chassis->getCrc();
|
||||
@@ -283,7 +283,7 @@ bool ShipComponentAttachmentManager::saveChassisInfo(std::string const & chassis
|
||||
std::string const & componentName = *it;
|
||||
ShipComponentDescriptor const * const shipComponentDescriptor = ShipComponentDescriptor::findShipComponentDescriptorByName(ConstCharCrcString(componentName.c_str()));
|
||||
|
||||
if (NULL == shipComponentDescriptor)
|
||||
if (nullptr == shipComponentDescriptor)
|
||||
return false;
|
||||
|
||||
uint32 const componentCrc = shipComponentDescriptor->getCrc();
|
||||
@@ -333,7 +333,7 @@ bool ShipComponentAttachmentManager::saveChassisInfo(std::string const & chassis
|
||||
std::string const & componentName = *it;
|
||||
ShipComponentDescriptor const * const shipComponentDescriptor = ShipComponentDescriptor::findShipComponentDescriptorByName(ConstCharCrcString(componentName.c_str()));
|
||||
|
||||
if (NULL == shipComponentDescriptor)
|
||||
if (nullptr == shipComponentDescriptor)
|
||||
return false;
|
||||
|
||||
uint32 const componentCrc = shipComponentDescriptor->getCrc();
|
||||
@@ -427,7 +427,7 @@ bool ShipComponentAttachmentManager::saveChassisInfo(std::string const & chassis
|
||||
|
||||
StdioFileFactory sff;
|
||||
AbstractFile * const af = sff.createFile(filenameTab.c_str(), "wb");
|
||||
if (NULL != af && af->isOpen())
|
||||
if (nullptr != af && af->isOpen())
|
||||
{
|
||||
int const bytesWritten = af->write(static_cast<int>(tabStr.size()), tabStr.c_str());
|
||||
retval = (bytesWritten == static_cast<int>(tabStr.size()));
|
||||
@@ -484,7 +484,7 @@ bool ShipComponentAttachmentManager::getAttachmentsForShip(uint32 chassisCrc, ui
|
||||
TemplateHardpointPairVector const & thpv = (*it).second;
|
||||
if (thpv.empty())
|
||||
{
|
||||
thpVectors[i] = NULL;
|
||||
thpVectors[i] = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -493,7 +493,7 @@ bool ShipComponentAttachmentManager::getAttachmentsForShip(uint32 chassisCrc, ui
|
||||
}
|
||||
}
|
||||
else
|
||||
thpVectors[i] = NULL;
|
||||
thpVectors[i] = nullptr;
|
||||
}
|
||||
|
||||
return found;
|
||||
|
||||
@@ -53,7 +53,7 @@ ShipComponentData::~ShipComponentData ()
|
||||
|
||||
void ShipComponentData::printDebugString (Unicode::String & result, Unicode::String const & padding) const
|
||||
{
|
||||
if (m_descriptor == NULL)
|
||||
if (m_descriptor == nullptr)
|
||||
return;
|
||||
|
||||
char buf [2048];
|
||||
|
||||
@@ -115,7 +115,7 @@ void ShipComponentDescriptor::load()
|
||||
DEBUG_WARNING(!sharedTemplateName.empty() && sharedCrcString.isEmpty(), ("Data error: in ship_components.tab - Component [%s] Shared template [%s] not found for row [%d]", name.c_str(), sharedTemplateName.c_str(), row));
|
||||
#endif
|
||||
|
||||
ShipComponentDescriptor * componentDescriptor = NULL;
|
||||
ShipComponentDescriptor * componentDescriptor = nullptr;
|
||||
|
||||
if (s_useWritableComponentDescriptor)
|
||||
componentDescriptor = new ShipComponentDescriptorWritable (TemporaryCrcString (name.c_str (), true), type, TemporaryCrcString (compatibility.c_str (), true), serverObjectTemplateName, sharedTemplateName);
|
||||
@@ -174,7 +174,7 @@ bool ShipComponentDescriptor::save(std::string const & filename)
|
||||
|
||||
StdioFileFactory sff;
|
||||
AbstractFile * const af = sff.createFile(filename.c_str(), "wb");
|
||||
if (NULL != af && af->isOpen())
|
||||
if (nullptr != af && af->isOpen())
|
||||
{
|
||||
int const bytesWritten = af->write(static_cast<int>(tabStr.size()), tabStr.c_str());
|
||||
retval = (bytesWritten == static_cast<int>(tabStr.size()));
|
||||
@@ -285,7 +285,7 @@ ShipComponentDescriptor const * ShipComponentDescriptor::findShipComponentDescri
|
||||
if (it != s_crcComponentMap.end ())
|
||||
return (*it).second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -297,7 +297,7 @@ ShipComponentDescriptor const * ShipComponentDescriptor::findShipComponentDescri
|
||||
if (it != s_nameComponentMap->end ())
|
||||
return (*it).second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -309,7 +309,7 @@ ShipComponentDescriptor const * ShipComponentDescriptor::findShipComponentDescri
|
||||
if (it != s_objectTemplateCrcComponentMap.end ())
|
||||
return (*it).second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -321,7 +321,7 @@ ShipComponentDescriptor const * ShipComponentDescriptor::findShipComponentDescri
|
||||
if (it != s_sharedObjectTemplateCrcComponentMap.end ())
|
||||
return (*it).second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -348,7 +348,7 @@ ShipComponentDescriptor::StringVector ShipComponentDescriptor::getComponentDescr
|
||||
bool ShipComponentDescriptor::setName(std::string const & name)
|
||||
{
|
||||
ShipComponentDescriptor const * const dupeNameShipComponentDescriptor = findShipComponentDescriptorByName(ConstCharCrcString(name.c_str()));
|
||||
if (NULL != dupeNameShipComponentDescriptor)
|
||||
if (nullptr != dupeNameShipComponentDescriptor)
|
||||
{
|
||||
WARNING(true, ("ShipComponentDescriptor attempt to set name [%s] already exists", name.c_str()));
|
||||
return false;
|
||||
@@ -379,14 +379,14 @@ bool ShipComponentDescriptor::setName(std::string const & name)
|
||||
bool ShipComponentDescriptor::setObjectTemplateCrcs(uint32 crc, uint32 sharedCrc)
|
||||
{
|
||||
ShipComponentDescriptor const * const dupeTemplateShipComponentDescriptor = findShipComponentDescriptorByObjectTemplate(crc);
|
||||
if (NULL != dupeTemplateShipComponentDescriptor && this != dupeTemplateShipComponentDescriptor)
|
||||
if (nullptr != dupeTemplateShipComponentDescriptor && this != dupeTemplateShipComponentDescriptor)
|
||||
{
|
||||
WARNING(true, ("ShipComponentDescriptor attempt to set ot crc [%s] already exists", dupeTemplateShipComponentDescriptor->getName().getString()));
|
||||
return false;
|
||||
}
|
||||
|
||||
ShipComponentDescriptor const * const dupeSharedTemplateShipComponentDescriptor = findShipComponentDescriptorBySharedObjectTemplate(crc);
|
||||
if (NULL != dupeSharedTemplateShipComponentDescriptor && this != dupeSharedTemplateShipComponentDescriptor)
|
||||
if (nullptr != dupeSharedTemplateShipComponentDescriptor && this != dupeSharedTemplateShipComponentDescriptor)
|
||||
{
|
||||
WARNING(true, ("ShipComponentDescriptor attempt to set shared ot crc [%s] already exists", dupeSharedTemplateShipComponentDescriptor->getName().getString()));
|
||||
return false;
|
||||
@@ -432,7 +432,7 @@ bool ShipComponentDescriptor::addShipComponentDescriptor(bool checkValidity, boo
|
||||
{
|
||||
{
|
||||
ShipComponentDescriptor const * const shipComponentDescriptor = findShipComponentDescriptorByName(m_name);
|
||||
if (NULL != shipComponentDescriptor)
|
||||
if (nullptr != shipComponentDescriptor)
|
||||
{
|
||||
WARNING(true, ("ShipComponentDescriptor::addShipComponentDescriptor name [%s] is already in map", m_name.getString()));
|
||||
return false;
|
||||
@@ -441,7 +441,7 @@ bool ShipComponentDescriptor::addShipComponentDescriptor(bool checkValidity, boo
|
||||
|
||||
{
|
||||
ShipComponentDescriptor const * const shipComponentDescriptor = findShipComponentDescriptorByCrc(getCrc());
|
||||
if (NULL != shipComponentDescriptor)
|
||||
if (nullptr != shipComponentDescriptor)
|
||||
{
|
||||
WARNING(true, ("ShipComponentDescriptor::addShipComponentDescriptor [%s] crc [0x%x] is already in map via [%s]", m_name.getString(), static_cast<int>(getCrc()), shipComponentDescriptor->getName().getString()));
|
||||
return false;
|
||||
@@ -453,7 +453,7 @@ bool ShipComponentDescriptor::addShipComponentDescriptor(bool checkValidity, boo
|
||||
if (0 != objectTemplateCrc)
|
||||
{
|
||||
ShipComponentDescriptor const * const shipComponentDescriptor = findShipComponentDescriptorByObjectTemplate(objectTemplateCrc);
|
||||
if (NULL != shipComponentDescriptor)
|
||||
if (nullptr != shipComponentDescriptor)
|
||||
{
|
||||
WARNING(true, ("ShipComponentDescriptor::addShipComponentDescriptor [%s] server template [%s] [0x%x] is already in map via [%s]", m_name.getString(), getObjectTemplateName().c_str(), static_cast<int>(getObjectTemplateCrc()), shipComponentDescriptor->getName().getString()));
|
||||
if (strict)
|
||||
@@ -467,7 +467,7 @@ bool ShipComponentDescriptor::addShipComponentDescriptor(bool checkValidity, boo
|
||||
if (0 != sharedObjectTemplateCrc)
|
||||
{
|
||||
ShipComponentDescriptor const * const shipComponentDescriptor = findShipComponentDescriptorBySharedObjectTemplate(sharedObjectTemplateCrc);
|
||||
if (NULL != shipComponentDescriptor)
|
||||
if (nullptr != shipComponentDescriptor)
|
||||
{
|
||||
WARNING(true, ("ShipComponentDescriptor::addShipComponentDescriptor [%s] shared template [%s] [0x%x] is already in map via [%s]", m_name.getString(), getSharedTemplateName().c_str(), static_cast<int>(getSharedObjectTemplateCrc()), shipComponentDescriptor->getName().getString()));
|
||||
if (strict)
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ bool ShipComponentDescriptorWritable::setName(std::string const & name)
|
||||
{
|
||||
if (ShipComponentDescriptor::setName(name))
|
||||
{
|
||||
if (NULL != ShipComponentDescriptor::findShipComponentDescriptorByCrc(Crc::normalizeAndCalculate(name.c_str())))
|
||||
if (nullptr != ShipComponentDescriptor::findShipComponentDescriptorByCrc(Crc::normalizeAndCalculate(name.c_str())))
|
||||
{
|
||||
notifyChanged();
|
||||
Transceivers::componentListChanged.emitMessage(true);
|
||||
|
||||
@@ -76,7 +76,7 @@ void ShipComponentWeaponManager::install()
|
||||
|
||||
DataTable * const dt = DataTableManager::getTable(filename, true);
|
||||
|
||||
if (dt == NULL)
|
||||
if (dt == nullptr)
|
||||
{
|
||||
WARNING(true, ("ShipComponentWeaponManager no such datatable [%s]", filename.c_str()));
|
||||
return;
|
||||
@@ -90,7 +90,7 @@ void ShipComponentWeaponManager::install()
|
||||
ShipComponentDescriptor const * const shipComponentDescriptor =
|
||||
ShipComponentDescriptor::findShipComponentDescriptorByName(TemporaryCrcString(componentName.c_str(), true));
|
||||
|
||||
if (shipComponentDescriptor == NULL)
|
||||
if (shipComponentDescriptor == nullptr)
|
||||
{
|
||||
WARNING(true, ("getComponentType datatable specified invalid component [%s]", componentName.c_str()));
|
||||
continue;
|
||||
|
||||
@@ -93,7 +93,7 @@ bool SuiPageData::addCommand(SuiCommand const & command)
|
||||
|
||||
SuiCommand const * const oldCommand = findSubscribeToEventCommand(eventType, targetWidget);
|
||||
|
||||
if (oldCommand != NULL)
|
||||
if (oldCommand != nullptr)
|
||||
{
|
||||
WARNING(true, ("SuiPageData::addCommand attempt to add duplicate SCT_subscribeToEvent command. Type=[%d], target=[%s]", eventType, targetWidget.c_str()));
|
||||
return false;
|
||||
@@ -130,7 +130,7 @@ void SuiPageData::subscribeToPropertyForEvent(int eventType, std::string const &
|
||||
{
|
||||
SuiCommand * const command = findSubscribeToEventCommand(eventType, eventWidgetName);
|
||||
|
||||
if (command == NULL)
|
||||
if (command == nullptr)
|
||||
{
|
||||
SuiCommand newCommand(SuiCommand::SCT_subscribeToEvent, eventWidgetName);
|
||||
newCommand.initSubscribeToEvent(eventType, std::string());
|
||||
@@ -148,7 +148,7 @@ bool SuiPageData::subscribeToEvent(int eventType, std::string const & eventWidge
|
||||
{
|
||||
SuiCommand * const command = findSubscribeToEventCommand(eventType, eventWidgetName);
|
||||
|
||||
if (command == NULL)
|
||||
if (command == nullptr)
|
||||
{
|
||||
SuiCommand newCommand(SuiCommand::SCT_subscribeToEvent, eventWidgetName);
|
||||
newCommand.initSubscribeToEvent(eventType, callback);
|
||||
@@ -182,7 +182,7 @@ SuiCommand * SuiPageData::findSubscribeToEventCommand(int const eventType, std::
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -203,7 +203,7 @@ SuiCommand * SuiPageData::findSubscribeToEventCommandByIndex(int const index)
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user