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:
DarthArgus
2016-02-11 21:19:18 -06:00
parent 8e2160f33e
commit dd9db6d350
937 changed files with 14983 additions and 14983 deletions
@@ -83,7 +83,7 @@ namespace AiCreatureControllerNamespace
bool s_installed = false;
typedef std::set<Client *> ObserverList;
PersistentCrcString * s_defaultCreatureName = NULL;
PersistentCrcString * s_defaultCreatureName = nullptr;
void remove();
Location getLocation(ServerObject const & serverObject);
@@ -97,7 +97,7 @@ void AiCreatureControllerNamespace::remove()
DEBUG_FATAL(!s_installed, ("Not installed."));
delete s_defaultCreatureName;
s_defaultCreatureName = NULL;
s_defaultCreatureName = nullptr;
s_installed = false;
}
@@ -106,9 +106,9 @@ void AiCreatureControllerNamespace::remove()
Location AiCreatureControllerNamespace::getLocation(ServerObject const & serverObject)
{
CellProperty const * const cellProperty = serverObject.getParentCell();
Object const * const cellObject = (cellProperty != NULL) ? &cellProperty->getOwner() : NULL;
Vector const & positionRelativeToCellOrWorld = (cellObject != NULL) ? serverObject.getPosition_c() : serverObject.getPosition_w();
NetworkId const & networkIdForCellOrWorld = (cellObject != NULL) ? cellObject->getNetworkId() : NetworkId::cms_invalid;
Object const * const cellObject = (cellProperty != nullptr) ? &cellProperty->getOwner() : nullptr;
Vector const & positionRelativeToCellOrWorld = (cellObject != nullptr) ? serverObject.getPosition_c() : serverObject.getPosition_w();
NetworkId const & networkIdForCellOrWorld = (cellObject != nullptr) ? cellObject->getNetworkId() : NetworkId::cms_invalid;
return Location(positionRelativeToCellOrWorld, networkIdForCellOrWorld, Location::getCrcBySceneName(serverObject.getSceneId()));
}
@@ -164,10 +164,10 @@ AICreatureController::~AICreatureController()
Object * const owner = getOwner();
if (owner != NULL && owner->isAuthoritative() && !getHibernate() && m_hibernationDelay.get() > 0 && m_hibernationTimer.get() > 0)
if (owner != nullptr && owner->isAuthoritative() && !getHibernate() && m_hibernationDelay.get() > 0 && m_hibernationTimer.get() > 0)
ObjectTracker::removeDelayedHibernatingAI();
if ( (owner != NULL)
if ( (owner != nullptr)
&& AiLogManager::isLogging(owner->getNetworkId()))
{
AiLogManager::setLogging(owner->getNetworkId(), false);
@@ -205,9 +205,9 @@ void AICreatureController::CreatureNameChangedCallback::modified(AICreatureContr
void AICreatureController::handleMessage (int message, float value, const MessageQueue::Data* const data, uint32 flags)
{
CreatureObject * const owner = static_cast<CreatureObject*>(getOwner());
if (owner == NULL)
if (owner == nullptr)
{
DEBUG_FATAL(true, ("Owner is NULL in AiCreatureController::handleMessage\n"));
DEBUG_FATAL(true, ("Owner is nullptr in AiCreatureController::handleMessage\n"));
return;
}
@@ -219,7 +219,7 @@ void AICreatureController::handleMessage (int message, float value, const Messag
AiMovementMessage const * const msg = safe_cast<const AiMovementMessage *>(data);
if (msg != NULL)
if (msg != nullptr)
{
if (owner->isAuthoritative())
{
@@ -256,7 +256,7 @@ void AICreatureController::handleMessage (int message, float value, const Messag
LOGC(AiLogManager::isLogging(getOwner()->getNetworkId()), "debug_ai", ("AICreatureController::handleMessage(CM_aiSetCreatureName) owner(%s)", getDebugInformation().c_str()));
MessageQueueGenericValueType<std::string> const * const msg = safe_cast<MessageQueueGenericValueType<std::string> const *>(data);
if (msg != NULL)
if (msg != nullptr)
{
setCreatureName(msg->getValue());
}
@@ -267,7 +267,7 @@ void AICreatureController::handleMessage (int message, float value, const Messag
LOGC(AiLogManager::isLogging(getOwner()->getNetworkId()), "debug_ai", ("AICreatureController::handleMessage(CM_aiSetHomeLocation) owner(%s)", getDebugInformation().c_str()));
MessageQueueGenericValueType<Location> const * const msg = safe_cast<MessageQueueGenericValueType<Location> const *>(data);
if (msg != NULL)
if (msg != nullptr)
{
setHomeLocation(msg->getValue());
}
@@ -278,7 +278,7 @@ void AICreatureController::handleMessage (int message, float value, const Messag
LOGC(AiLogManager::isLogging(getOwner()->getNetworkId()), "debug_ai", ("AICreatureController::handleMessage(CM_aiSetFrozen) owner(%s)", getDebugInformation().c_str()));
MessageQueueGenericValueType<bool> const * const msg = safe_cast<MessageQueueGenericValueType<bool> const *>(data);
if (msg != NULL)
if (msg != nullptr)
{
setFrozen(msg->getValue());
}
@@ -289,7 +289,7 @@ void AICreatureController::handleMessage (int message, float value, const Messag
LOGC(AiLogManager::isLogging(getOwner()->getNetworkId()), "debug_ai", ("AICreatureController::handleMessage(CM_aiSetRetreating) owner(%s)", getDebugInformation().c_str()));
MessageQueueGenericValueType<bool> const * const msg = safe_cast<MessageQueueGenericValueType<bool> const *>(data);
if (msg != NULL)
if (msg != nullptr)
{
setRetreating(msg->getValue());
}
@@ -300,7 +300,7 @@ void AICreatureController::handleMessage (int message, float value, const Messag
LOGC(AiLogManager::isLogging(getOwner()->getNetworkId()), "debug_ai", ("AICreatureController::handleMessage(CM_aiSetLogging) owner(%s)", getDebugInformation().c_str()));
MessageQueueGenericValueType<bool> const * const msg = safe_cast<MessageQueueGenericValueType<bool> const *>(data);
if (msg != NULL)
if (msg != nullptr)
{
setLogging(msg->getValue());
}
@@ -333,7 +333,7 @@ void AICreatureController::handleMessage (int message, float value, const Messag
case CM_setHibernationDelay:
{
MessageQueueGenericValueType<float> const * const msg = safe_cast<MessageQueueGenericValueType<float> const *>(data);
if (msg != NULL)
if (msg != nullptr)
setHibernationDelay(msg->getValue());
}
break;
@@ -469,7 +469,7 @@ float AICreatureController::realAlter(float time)
CreatureObject * const creatureOwner = getCreature();
#ifdef _DEBUG
AiDebugString * aiDebugString = NULL;
AiDebugString * aiDebugString = nullptr;
if (!creatureOwner->getObservers().empty())
{
aiDebugString = new AiDebugString;
@@ -508,7 +508,7 @@ float AICreatureController::realAlter(float time)
if (!creatureOwner->isInWorld() || getHibernate())
{
#ifdef _DEBUG
if (aiDebugString != NULL)
if (aiDebugString != nullptr)
{
sendDebugAiToClients(*aiDebugString);
delete aiDebugString;
@@ -522,8 +522,8 @@ float AICreatureController::realAlter(float time)
// check floating
{
CollisionProperty const * const collision = creatureOwner->getCollisionProperty();
Footprint const * const foot = (collision != NULL) ? collision->getFootprint() : NULL;
bool floating = (foot != NULL) ? foot->isFloating() : false;
Footprint const * const foot = (collision != nullptr) ? collision->getFootprint() : nullptr;
bool floating = (foot != nullptr) ? foot->isFloating() : false;
if (floating)
{
@@ -547,7 +547,7 @@ float AICreatureController::realAlter(float time)
// Update our inPathfindingRegion flag whenever the behavior changes
CityPathGraph const * graph = CityPathGraphManager::getCityGraphFor(creatureOwner);
m_inPathfindingRegion = (graph != NULL);
m_inPathfindingRegion = (graph != nullptr);
applyMovementChange();
}
@@ -589,10 +589,10 @@ float AICreatureController::realAlter(float time)
bool resetHateTimer = false;
CachedNetworkId const & hateTarget = creatureOwner->getHateTarget();
CreatureObject * const hateTargetCreatureObject = CreatureObject::asCreatureObject(hateTarget.getObject());
CreatureController const * const hateTargetCreatureController = (hateTargetCreatureObject != NULL) ? CreatureController::asCreatureController(hateTargetCreatureObject->getController()) : NULL;
CreatureController const * const hateTargetCreatureController = (hateTargetCreatureObject != nullptr) ? CreatureController::asCreatureController(hateTargetCreatureObject->getController()) : nullptr;
if ( (hateTargetCreatureObject != NULL)
&& (hateTargetCreatureController != NULL))
if ( (hateTargetCreatureObject != nullptr)
&& (hateTargetCreatureController != nullptr))
{
float const hateTargetMovementSpeedSquared = hateTargetCreatureController->getCurrentVelocity().magnitudeSquared();
float const hateTargetWalkSpeedSquared = sqr(hateTargetCreatureObject->getWalkSpeed());
@@ -605,7 +605,7 @@ float AICreatureController::realAlter(float time)
{
Object * const combatStartLocationCell = NetworkIdManager::getObjectById(m_combatStartLocation.get().getCell());
Vector const & combatStartPosition_c = m_combatStartLocation.get().getCoordinates();
Vector const & combatStartPosition_w = (combatStartLocationCell != NULL) ? combatStartLocationCell->rotateTranslate_o2w(combatStartPosition_c) : combatStartPosition_c;
Vector const & combatStartPosition_w = (combatStartLocationCell != nullptr) ? combatStartLocationCell->rotateTranslate_o2w(combatStartPosition_c) : combatStartPosition_c;
float const distanceToCombatStartLocationSquared = creatureOwner->getPosition_w().magnitudeBetweenSquared(combatStartPosition_w);
float const aggroRadius = getAggroRadius();
@@ -621,7 +621,7 @@ float AICreatureController::realAlter(float time)
hateTargetCreatureObject->resetHateTimer();
}
}
else if (hateTarget.getObject() != NULL)
else if (hateTarget.getObject() != nullptr)
{
// AI don't need to lose interest in stationary AI
@@ -662,7 +662,7 @@ float AICreatureController::realAlter(float time)
}
#ifdef _DEBUG
if (aiDebugString != NULL)
if (aiDebugString != nullptr)
{
m_movement->addDebug(*aiDebugString);
}
@@ -697,7 +697,7 @@ float AICreatureController::realAlter(float time)
updateMovementType();
#ifdef _DEBUG
if (aiDebugString != NULL)
if (aiDebugString != nullptr)
{
sendDebugAiToClients(*aiDebugString);
delete aiDebugString;
@@ -711,7 +711,7 @@ float AICreatureController::realAlter(float time)
//----------------------------------------------------------------------
void AICreatureController::changeMovement(AiMovementBasePtr newMovement)
{
LOGC(AiLogManager::isLogging(getOwner()->getNetworkId()), "debug_ai", ("AICreatureController::changeMovement() movement(%s)", (newMovement != AiMovementBaseNullPtr) ? AiMovementBase::getMovementString(newMovement->getType()) : "NULL"));
LOGC(AiLogManager::isLogging(getOwner()->getNetworkId()), "debug_ai", ("AICreatureController::changeMovement() movement(%s)", (newMovement != AiMovementBaseNullPtr) ? AiMovementBase::getMovementString(newMovement->getType()) : "nullptr"));
if (getOwner()->isAuthoritative())
{
@@ -876,11 +876,11 @@ void AICreatureController::loiter(CellProperty const * homeCell, Vector const &
{
if (isRetreating())
{
WARNING(true, ("AICreatureController::loiter() owner(%s) cell(%s) home(%.0f, %.0f, %.0f) distance[%.2f...%.2f] delay[%.0f...%.0f] Trying to loiter while retreating, failing request.", getDebugInformation().c_str(), ((homeCell != NULL) ? homeCell->getCellName() : "NULL"), home_p.x, home_p.y, home_p.z, minDistance, maxDistance, minDelay, maxDelay));
WARNING(true, ("AICreatureController::loiter() owner(%s) cell(%s) home(%.0f, %.0f, %.0f) distance[%.2f...%.2f] delay[%.0f...%.0f] Trying to loiter while retreating, failing request.", getDebugInformation().c_str(), ((homeCell != nullptr) ? homeCell->getCellName() : "nullptr"), home_p.x, home_p.y, home_p.z, minDistance, maxDistance, minDelay, maxDelay));
return;
}
LOGC(AiLogManager::isLogging(getOwner()->getNetworkId()), "debug_ai", ("AICreatureController::loiter() owner(%s) cell(%s) home(%.0f, %.0f, %.0f) distance[%.2f...%.2f] delay[%.0f...%.0f]", getDebugInformation().c_str(), ((homeCell != NULL) ? homeCell->getCellName() : "NULL"), home_p.x, home_p.y, home_p.z, minDistance, maxDistance, minDelay, maxDelay));
LOGC(AiLogManager::isLogging(getOwner()->getNetworkId()), "debug_ai", ("AICreatureController::loiter() owner(%s) cell(%s) home(%.0f, %.0f, %.0f) distance[%.2f...%.2f] delay[%.0f...%.0f]", getDebugInformation().c_str(), ((homeCell != nullptr) ? homeCell->getCellName() : "nullptr"), home_p.x, home_p.y, home_p.z, minDistance, maxDistance, minDelay, maxDelay));
AiMovementBasePtr movement(new AiMovementLoiter(this, homeCell, home_p, minDistance, maxDistance, minDelay, maxDelay));
@@ -910,7 +910,7 @@ void AICreatureController::moveTo(CellProperty const * cell, Vector const & targ
{
if (isRetreating())
{
WARNING(true, ("AICreatureController::moveTo() owner(%s) cell(%s) position(%.0f, %.0f, %.0f) radius(%.2f) Trying to moveTo while retreating, failing request.", getDebugInformation().c_str(), ((cell != NULL) ? cell->getCellName() : "NULL"), target_p.x, target_p.y, target_p.z, radius));
WARNING(true, ("AICreatureController::moveTo() owner(%s) cell(%s) position(%.0f, %.0f, %.0f) radius(%.2f) Trying to moveTo while retreating, failing request.", getDebugInformation().c_str(), ((cell != nullptr) ? cell->getCellName() : "nullptr"), target_p.x, target_p.y, target_p.z, radius));
return;
}
@@ -918,9 +918,9 @@ void AICreatureController::moveTo(CellProperty const * cell, Vector const & targ
if (getMovementType() == AMT_move)
{
AiMovementMove * const aiMovementMove = (m_movement != AiMovementBaseNullPtr) ? m_movement->asAiMovementMove() : NULL;
AiMovementMove * const aiMovementMove = (m_movement != AiMovementBaseNullPtr) ? m_movement->asAiMovementMove() : nullptr;
if (aiMovementMove != NULL)
if (aiMovementMove != nullptr)
{
AiLocation const & target = aiMovementMove->getTarget();
@@ -935,7 +935,7 @@ void AICreatureController::moveTo(CellProperty const * cell, Vector const & targ
if (!duplicateMovement)
{
LOGC(AiLogManager::isLogging(getOwner()->getNetworkId()), "debug_ai", ("AICreatureController::moveTo() owner(%s) cell(%s) position(%.0f, %.0f, %.0f) radius(%.2f)", getDebugInformation().c_str(), ((cell != NULL) ? cell->getCellName() : "NULL"), target_p.x, target_p.y, target_p.z, radius));
LOGC(AiLogManager::isLogging(getOwner()->getNetworkId()), "debug_ai", ("AICreatureController::moveTo() owner(%s) cell(%s) position(%.0f, %.0f, %.0f) radius(%.2f)", getDebugInformation().c_str(), ((cell != nullptr) ? cell->getCellName() : "nullptr"), target_p.x, target_p.y, target_p.z, radius));
AiMovementBasePtr movement(new AiMovementMove(this, cell, target_p, radius));
@@ -957,9 +957,9 @@ void AICreatureController::moveTo(Unicode::String const & targetName)
if (getMovementType() == AMT_move)
{
AiMovementMove * const aiMovementMove = (m_movement != AiMovementBaseNullPtr) ? m_movement->asAiMovementMove() : NULL;
AiMovementMove * const aiMovementMove = (m_movement != AiMovementBaseNullPtr) ? m_movement->asAiMovementMove() : nullptr;
if (aiMovementMove != NULL)
if (aiMovementMove != nullptr)
{
if (aiMovementMove->getTargetName() == targetName)
{
@@ -992,8 +992,8 @@ void AICreatureController::patrol( std::vector<Location> const & locations, bool
if (getMovementType() == AMT_patrol)
{
AiMovementPatrol * const aiMovementPatrol = (m_movement != AiMovementBaseNullPtr) ? m_movement->asAiMovementPatrol() : NULL;
if (aiMovementPatrol != NULL)
AiMovementPatrol * const aiMovementPatrol = (m_movement != AiMovementBaseNullPtr) ? m_movement->asAiMovementPatrol() : nullptr;
if (aiMovementPatrol != nullptr)
{
// if ()
// {
@@ -1026,8 +1026,8 @@ void AICreatureController::patrol( std::vector<Unicode::String> const & location
if (getMovementType() == AMT_patrol)
{
AiMovementPatrol * const aiMovementPatrol = (m_movement != AiMovementBaseNullPtr) ? m_movement->asAiMovementPatrol() : NULL;
if (aiMovementPatrol != NULL)
AiMovementPatrol * const aiMovementPatrol = (m_movement != AiMovementBaseNullPtr) ? m_movement->asAiMovementPatrol() : nullptr;
if (aiMovementPatrol != nullptr)
{
// if ()
// {
@@ -1071,7 +1071,7 @@ bool AICreatureController::faceTo(CellProperty const * targetCell, Vector const
{
if (isRetreating())
{
WARNING(true, ("AICreatureController::faceTo() owner(%s) cell(%s) position(%.0f, %.0f, %.0f) Trying to faceTo while retreating, failing faceTo request.", getDebugInformation().c_str(), ((targetCell != NULL) ? targetCell->getCellName() : "NULL"), target_p.x, target_p.y, target_p.z));
WARNING(true, ("AICreatureController::faceTo() owner(%s) cell(%s) position(%.0f, %.0f, %.0f) Trying to faceTo while retreating, failing faceTo request.", getDebugInformation().c_str(), ((targetCell != nullptr) ? targetCell->getCellName() : "nullptr"), target_p.x, target_p.y, target_p.z));
return false;
}
@@ -1079,9 +1079,9 @@ bool AICreatureController::faceTo(CellProperty const * targetCell, Vector const
if (getMovementType() == AMT_face)
{
AiMovementFace * const aiMovementFace = (m_movement != AiMovementBaseNullPtr) ? m_movement->asAiMovementFace() : NULL;
AiMovementFace * const aiMovementFace = (m_movement != AiMovementBaseNullPtr) ? m_movement->asAiMovementFace() : nullptr;
if (aiMovementFace != NULL)
if (aiMovementFace != nullptr)
{
AiLocation const & target = aiMovementFace->getTarget();
@@ -1095,7 +1095,7 @@ bool AICreatureController::faceTo(CellProperty const * targetCell, Vector const
if (!duplicateMovement)
{
LOGC(AiLogManager::isLogging(getOwner()->getNetworkId()), "debug_ai", ("AICreatureController::faceTo() owner(%s) cell(%s) position(%.0f, %.0f, %.0f)", getDebugInformation().c_str(), ((targetCell != NULL) ? targetCell->getCellName() : "NULL"), target_p.x, target_p.y, target_p.z));
LOGC(AiLogManager::isLogging(getOwner()->getNetworkId()), "debug_ai", ("AICreatureController::faceTo() owner(%s) cell(%s) position(%.0f, %.0f, %.0f)", getDebugInformation().c_str(), ((targetCell != nullptr) ? targetCell->getCellName() : "nullptr"), target_p.x, target_p.y, target_p.z));
AiMovementBasePtr behavior(new AiMovementFace(this, targetCell, target_p));
@@ -1126,9 +1126,9 @@ bool AICreatureController::faceTo( NetworkId const & targetId )
if (getMovementType() == AMT_face)
{
AiMovementFace * const aiMovementFace = (m_movement != AiMovementBaseNullPtr) ? m_movement->asAiMovementFace() : NULL;
AiMovementFace * const aiMovementFace = (m_movement != AiMovementBaseNullPtr) ? m_movement->asAiMovementFace() : nullptr;
if (aiMovementFace != NULL)
if (aiMovementFace != nullptr)
{
AiLocation const & target = aiMovementFace->getTarget();
@@ -1171,9 +1171,9 @@ bool AICreatureController::follow( NetworkId const & targetId, float minDistance
if (getMovementType() == AMT_follow)
{
AiMovementFollow * const aiMovementFollow = (m_movement != AiMovementBaseNullPtr) ? m_movement->asAiMovementFollow() : NULL;
AiMovementFollow * const aiMovementFollow = (m_movement != AiMovementBaseNullPtr) ? m_movement->asAiMovementFollow() : nullptr;
if (aiMovementFollow != NULL)
if (aiMovementFollow != nullptr)
{
AiLocation const & target = aiMovementFollow->getTarget();
@@ -1219,9 +1219,9 @@ bool AICreatureController::follow( NetworkId const & targetId, Vector const & of
if (getMovementType() == AMT_follow)
{
AiMovementFollow * const aiMovementFollow = (m_movement != AiMovementBaseNullPtr) ? m_movement->asAiMovementFollow() : NULL;
AiMovementFollow * const aiMovementFollow = (m_movement != AiMovementBaseNullPtr) ? m_movement->asAiMovementFollow() : nullptr;
if (aiMovementFollow != NULL)
if (aiMovementFollow != nullptr)
{
AiLocation const & offsetTarget = aiMovementFollow->getOffsetTarget();
@@ -1403,9 +1403,9 @@ void AICreatureController::moveCreature( CellProperty const * newCell, Vector co
CellProperty * currentCell = getOwner()->getParentCell();
CellObject * newCellObject = NULL;
CellObject * newCellObject = nullptr;
if( (newCell != NULL) && (newCell != CellProperty::getWorldCellProperty()) )
if( (newCell != nullptr) && (newCell != CellProperty::getWorldCellProperty()) )
{
newCellObject = const_cast<CellObject*>(safe_cast<CellObject const *>(&newCell->getOwner()));
}
@@ -1422,12 +1422,12 @@ void AICreatureController::moveCreature( CellProperty const * newCell, Vector co
CellProperty const * destCell = getCreatureCell()->getDestinationCell(oldPosition+offset,newPosition+offset,dummy);
if((destCell != NULL) && (destCell != newCell))
if((destCell != nullptr) && (destCell != newCell))
{
newPosition = CollisionUtils::transformToCell(newCell,newPosition,destCell);
newCell = destCell;
newCellObject = NULL;
newCellObject = nullptr;
if(newCell != CellProperty::getWorldCellProperty())
{
@@ -1820,15 +1820,15 @@ AICreatureController * AICreatureController::getAiCreatureController(NetworkId c
{
Object * const object = NetworkIdManager::getObjectById(networkId);
return (object != NULL) ? AICreatureController::asAiCreatureController(object->getController()) : NULL;
return (object != nullptr) ? AICreatureController::asAiCreatureController(object->getController()) : nullptr;
}
// ----------------------------------------------------------------------
AICreatureController * AICreatureController::asAiCreatureController(Controller * controller)
{
CreatureController * const creatureController = (controller != NULL) ? controller->asCreatureController() : NULL;
AICreatureController * const aiCreatureController = (creatureController != NULL) ? creatureController->asAiCreatureController() : NULL;
CreatureController * const creatureController = (controller != nullptr) ? controller->asCreatureController() : nullptr;
AICreatureController * const aiCreatureController = (creatureController != nullptr) ? creatureController->asAiCreatureController() : nullptr;
return aiCreatureController;
}
@@ -1837,8 +1837,8 @@ AICreatureController * AICreatureController::asAiCreatureController(Controller *
AICreatureController const * AICreatureController::asAiCreatureController(Controller const * controller)
{
CreatureController const * const creatureController = (controller != NULL) ? controller->asCreatureController() : NULL;
AICreatureController const * const aiCreatureController = (creatureController != NULL) ? creatureController->asAiCreatureController() : NULL;
CreatureController const * const creatureController = (controller != nullptr) ? controller->asCreatureController() : nullptr;
AICreatureController const * const aiCreatureController = (creatureController != nullptr) ? creatureController->asAiCreatureController() : nullptr;
return aiCreatureController;
}
@@ -1880,7 +1880,7 @@ float AICreatureController::getRespectRadius(NetworkId const & target) const
CreatureObject const * respectCreatureObject = CreatureObject::getCreatureObject(target);
if (respectCreatureObject != NULL)
if (respectCreatureObject != nullptr)
{
// If the target has a master, then use the master's level for the respect calculation
@@ -1893,7 +1893,7 @@ float AICreatureController::getRespectRadius(NetworkId const & target) const
// Respect is only towards players
if ( (respectCreatureObject != NULL)
if ( (respectCreatureObject != nullptr)
&& respectCreatureObject->isPlayerControlled())
{
CreatureObject const * const creatureOwner = getCreature();
@@ -1906,7 +1906,7 @@ float AICreatureController::getRespectRadius(NetworkId const & target) const
}
else
{
WARNING(true, ("AICreatureController::getRespectRadius() owner(%s) master(%s) The owner has a master who is not a player. Why does this happen?", getDebugInformation().c_str(), (respectCreatureObject != NULL) ? respectCreatureObject->getDebugInformation().c_str() : masterId.getValueString().c_str()));
WARNING(true, ("AICreatureController::getRespectRadius() owner(%s) master(%s) The owner has a master who is not a player. Why does this happen?", getDebugInformation().c_str(), (respectCreatureObject != nullptr) ? respectCreatureObject->getDebugInformation().c_str() : masterId.getValueString().c_str()));
}
}
@@ -1942,7 +1942,7 @@ void AICreatureController::sendDebugAiToClients(AiDebugString & aiDebugString)
// Display the name and level
{
aiDebugString.addText(fs.sprintf("%d %s\n", creatureOwner->getLevel(), (getCreatureName().isEmpty() ? "NULL" : getCreatureName().getString())), PackedRgb::solidWhite);
aiDebugString.addText(fs.sprintf("%d %s\n", creatureOwner->getLevel(), (getCreatureName().isEmpty() ? "nullptr" : getCreatureName().getString())), PackedRgb::solidWhite);
}
// Display the look at target
@@ -1990,7 +1990,7 @@ void AICreatureController::sendDebugAiToClients(AiDebugString & aiDebugString)
{
Floor const * const floor = CollisionWorld::getFloorStandingOn(*creatureOwner);
aiDebugString.addText(fs.sprintf("floor (%s)\n", (floor == NULL) ? "none" : floor->getId().getValueString().c_str()), PackedRgb::solidWhite);
aiDebugString.addText(fs.sprintf("floor (%s)\n", (floor == nullptr) ? "none" : floor->getId().getValueString().c_str()), PackedRgb::solidWhite);
}
// Display the AI movement speed
@@ -2008,15 +2008,15 @@ void AICreatureController::sendDebugAiToClients(AiDebugString & aiDebugString)
// Primary Weapon
{
ServerObject const * const primaryServerObject = ServerObject::getServerObject(getPrimaryWeapon());
WeaponObject const * const primaryWeaponObject = (primaryServerObject != NULL) ? primaryServerObject->asWeaponObject() : NULL;
WeaponObject const * const primaryWeaponObject = (primaryServerObject != nullptr) ? primaryServerObject->asWeaponObject() : nullptr;
if (primaryWeaponObject != NULL)
if (primaryWeaponObject != nullptr)
{
aiDebugString.addText(fs.sprintf("%s pri(%s) [%.0f...%.0f] sp(%s)\n", (usingPrimaryWeapon() ? "->" : ""), FileNameUtils::get(primaryWeaponObject->getObjectTemplateName(), FileNameUtils::fileName).c_str(), primaryWeaponObject->getMinRange(), primaryWeaponObject->getMaxRange(), m_aiCreatureData->m_primarySpecials.isEmpty() ? "none" : m_aiCreatureData->m_primarySpecials.getString()), PackedRgb::solidWhite);
}
else
{
aiDebugString.addText(fs.sprintf("pri(NULL:ERROR)\n"), PackedRgb::solidWhite);
aiDebugString.addText(fs.sprintf("pri(nullptr:ERROR)\n"), PackedRgb::solidWhite);
}
//if (usingPrimaryWeapon())
@@ -2040,9 +2040,9 @@ void AICreatureController::sendDebugAiToClients(AiDebugString & aiDebugString)
// Secondary Weapon
{
ServerObject const * const secondaryServerObject = ServerObject::getServerObject(getSecondaryWeapon());
WeaponObject const * const secondaryWeaponObject = (secondaryServerObject != NULL) ? secondaryServerObject->asWeaponObject() : NULL;
WeaponObject const * const secondaryWeaponObject = (secondaryServerObject != nullptr) ? secondaryServerObject->asWeaponObject() : nullptr;
if (secondaryWeaponObject != NULL)
if (secondaryWeaponObject != nullptr)
{
aiDebugString.addText(fs.sprintf("%s sec (%s) [%.0f...%.0f] sp(%s)\n", (usingSecondaryWeapon() ? "->" : ""), FileNameUtils::get(secondaryWeaponObject->getObjectTemplateName(), FileNameUtils::fileName).c_str(), secondaryWeaponObject->getMinRange(), secondaryWeaponObject->getMaxRange(), m_aiCreatureData->m_secondarySpecials.isEmpty() ? "none" : m_aiCreatureData->m_secondarySpecials.getString()), PackedRgb::solidWhite);
}
@@ -2113,13 +2113,13 @@ void AICreatureController::sendDebugAiToClients(AiDebugString & aiDebugString)
TangibleObject const * const hateTargetTangibleObject = TangibleObject::asTangibleObject(hateTarget.getObject());
float const hate = iterHateList->second;
std::string hateTargetName;
if (hateTargetTangibleObject != NULL)
if (hateTargetTangibleObject != nullptr)
{
hateTargetName = Unicode::wideToNarrow(hateTargetTangibleObject->getEncodedObjectName()).c_str();
}
else
{
hateTargetName = "NULL";
hateTargetName = "nullptr";
}
aiDebugString.addText(fs.sprintf("%s:%s(%.1f)\n", hateTargetName.c_str(), hateTarget.getValueString().c_str(), hate), (iterHateList == hateList.begin()) ? PackedRgb::solidGreen : PackedRgb::solidRed);
@@ -2174,7 +2174,7 @@ void AICreatureController::sendDebugAiToClients(AiDebugString & aiDebugString)
// Only send to the client if the objvar is set
int temp = 0;
if ( (characterObject != NULL)
if ( (characterObject != nullptr)
&& characterObject->getObjVars().getItem("ai_debug_string", temp))
{
if (temp > 0)
@@ -2196,7 +2196,7 @@ void AICreatureController::setHomeLocation(Location const & location)
{
if (getOwner()->isAuthoritative())
{
LOGC(AiLogManager::isLogging(getOwner()->getNetworkId()), "debug_ai", ("AICreatureController::setHomeLocation() owner(%s) sceneId(%u:%s) cell(%s) coordinates(%.2f, %.2f, %.2f)", getDebugInformation().c_str(), location.getSceneIdCrc(), (location.getSceneId() != NULL) ? location.getSceneId() : "NULL", location.getCell().getValueString().c_str(), location.getCoordinates().x, location.getCoordinates().y, location.getCoordinates().z));
LOGC(AiLogManager::isLogging(getOwner()->getNetworkId()), "debug_ai", ("AICreatureController::setHomeLocation() owner(%s) sceneId(%u:%s) cell(%s) coordinates(%.2f, %.2f, %.2f)", getDebugInformation().c_str(), location.getSceneIdCrc(), (location.getSceneId() != nullptr) ? location.getSceneId() : "nullptr", location.getCell().getValueString().c_str(), location.getCoordinates().x, location.getCoordinates().y, location.getCoordinates().z));
m_homeLocation = location;
}
@@ -2221,7 +2221,7 @@ void AICreatureController::markCombatStartLocation()
{
m_combatStartLocation = getLocation(*creatureOwner);
LOGC(AiLogManager::isLogging(creatureOwner->getNetworkId()), "debug_ai", ("AICreatureController::markCombatStartLocation() owner(%s) sceneId(%u:%s) cell(%s) coordinates(%.2f, %.2f, %.2f)", getDebugInformation().c_str(), m_combatStartLocation.get().getSceneIdCrc(), (m_combatStartLocation.get().getSceneId() != NULL) ? m_combatStartLocation.get().getSceneId() : "NULL", m_combatStartLocation.get().getCell().getValueString().c_str(), m_combatStartLocation.get().getCoordinates().x, m_combatStartLocation.get().getCoordinates().y, m_combatStartLocation.get().getCoordinates().z));
LOGC(AiLogManager::isLogging(creatureOwner->getNetworkId()), "debug_ai", ("AICreatureController::markCombatStartLocation() owner(%s) sceneId(%u:%s) cell(%s) coordinates(%.2f, %.2f, %.2f)", getDebugInformation().c_str(), m_combatStartLocation.get().getSceneIdCrc(), (m_combatStartLocation.get().getSceneId() != nullptr) ? m_combatStartLocation.get().getSceneId() : "nullptr", m_combatStartLocation.get().getCell().getValueString().c_str(), m_combatStartLocation.get().getCoordinates().x, m_combatStartLocation.get().getCoordinates().y, m_combatStartLocation.get().getCoordinates().z));
m_primaryWeaponActions.reset();
m_secondaryWeaponActions.reset();
@@ -2279,14 +2279,14 @@ void AICreatureController::onCreatureNameChanged(std::string const & creatureNam
AiCreatureCombatProfile const * const primaryWeaponCombatProfile = AiCreatureCombatProfile::getCombatProfile(m_aiCreatureData->m_primarySpecials);
if (primaryWeaponCombatProfile != NULL)
if (primaryWeaponCombatProfile != nullptr)
{
m_primaryWeaponActions.setCombatProfile(*creatureOwner, *primaryWeaponCombatProfile);
}
AiCreatureCombatProfile const * const secondaryWeaponCombatProfile = AiCreatureCombatProfile::getCombatProfile(m_aiCreatureData->m_secondarySpecials);
if (secondaryWeaponCombatProfile != NULL)
if (secondaryWeaponCombatProfile != nullptr)
{
m_secondaryWeaponActions.setCombatProfile(*creatureOwner, *secondaryWeaponCombatProfile);
}
@@ -2326,7 +2326,7 @@ void AICreatureController::destroyPrimaryWeapon()
{
WeaponObject * const primaryWeapon = WeaponObject::getWeaponObject(getPrimaryWeapon());
if (primaryWeapon != NULL)
if (primaryWeapon != nullptr)
{
unEquipWeapons();
primaryWeapon->permanentlyDestroy(DeleteReasons::God);
@@ -2361,7 +2361,7 @@ void AICreatureController::destroySecondaryWeapon()
{
WeaponObject * const secondaryWeapon = WeaponObject::getWeaponObject(getSecondaryWeapon());
if (secondaryWeapon != NULL)
if (secondaryWeapon != nullptr)
{
unEquipWeapons();
secondaryWeapon->permanentlyDestroy(DeleteReasons::God);
@@ -2372,7 +2372,7 @@ void AICreatureController::destroySecondaryWeapon()
PersistentCrcString const & AICreatureController::getCreatureName() const
{
if (m_aiCreatureData->m_name == NULL)
if (m_aiCreatureData->m_name == nullptr)
{
return *s_defaultCreatureName;
}
@@ -2401,7 +2401,7 @@ NetworkId AICreatureController::createWeapon(char const * const functionName, Cr
CreatureObject * const creatureOwner = getCreature();
ServerObject * const inventory = creatureOwner->getInventory();
if (inventory == NULL)
if (inventory == nullptr)
{
WARNING(true, ("AICreatureController::%s() Unable to find inventory for (%s) to place a weapon(%s)", functionName, getDebugInformation().c_str(), weaponName.getString()));
}
@@ -2440,7 +2440,7 @@ NetworkId AICreatureController::createWeapon(char const * const functionName, Cr
bool const persisted = false;
ServerObject * const newObject = ServerWorld::createNewObject(weaponCrcName.getCrc(), *inventory, persisted);
if (newObject != NULL)
if (newObject != nullptr)
{
result = newObject->getNetworkId();
}
@@ -2464,7 +2464,7 @@ NetworkId AICreatureController::getUnarmedWeapon()
CreatureObject * const creatureOwner = getCreature();
WeaponObject * const defaultWeapon = creatureOwner->getDefaultWeapon();
if (defaultWeapon != NULL)
if (defaultWeapon != nullptr)
{
result = defaultWeapon->getNetworkId();
}
@@ -2492,9 +2492,9 @@ void AICreatureController::equipPrimaryWeapon()
if (!usingPrimaryWeapon())
{
ServerObject * const primaryWeaponServerObject = ServerObject::getServerObject(getPrimaryWeapon());
WeaponObject * const primaryWeaponObject = (primaryWeaponServerObject != NULL) ? primaryWeaponServerObject->asWeaponObject() : NULL;
WeaponObject * const primaryWeaponObject = (primaryWeaponServerObject != nullptr) ? primaryWeaponServerObject->asWeaponObject() : nullptr;
if (primaryWeaponObject != NULL)
if (primaryWeaponObject != nullptr)
{
unEquipWeapons();
@@ -2508,7 +2508,7 @@ void AICreatureController::equipPrimaryWeapon()
{
Container::ContainerErrorCode errorCode;
if (ContainerInterface::transferItemToGeneralContainer(*creatureOwner, *primaryWeaponServerObject, NULL, errorCode))
if (ContainerInterface::transferItemToGeneralContainer(*creatureOwner, *primaryWeaponServerObject, nullptr, errorCode))
{
LOGC(AiLogManager::isLogging(getOwner()->getNetworkId()), "debug_ai", ("AICreatureController::equipPrimaryWeapon() owner(%s) primaryWeapon(%s)\n", getDebugInformation().c_str(), primaryWeaponServerObject->getDebugInformation().c_str()));
@@ -2516,7 +2516,7 @@ void AICreatureController::equipPrimaryWeapon()
GameScriptObject * const gameScriptObject = GameScriptObject::asGameScriptObject(creatureOwner);
if (gameScriptObject != NULL)
if (gameScriptObject != nullptr)
{
ScriptParams scriptParams;
scriptParams.addParam(primaryWeaponObject->getNetworkId());
@@ -2557,9 +2557,9 @@ void AICreatureController::equipSecondaryWeapon()
if (!usingSecondaryWeapon())
{
ServerObject * const secondaryWeaponServerObject = ServerObject::getServerObject(getSecondaryWeapon());
WeaponObject * const secondaryWeaponObject = (secondaryWeaponServerObject != NULL) ? secondaryWeaponServerObject->asWeaponObject() : NULL;
WeaponObject * const secondaryWeaponObject = (secondaryWeaponServerObject != nullptr) ? secondaryWeaponServerObject->asWeaponObject() : nullptr;
if (secondaryWeaponObject != NULL)
if (secondaryWeaponObject != nullptr)
{
unEquipWeapons();
@@ -2573,7 +2573,7 @@ void AICreatureController::equipSecondaryWeapon()
{
Container::ContainerErrorCode errorCode;
if (ContainerInterface::transferItemToGeneralContainer(*creatureOwner, *secondaryWeaponServerObject, NULL, errorCode))
if (ContainerInterface::transferItemToGeneralContainer(*creatureOwner, *secondaryWeaponServerObject, nullptr, errorCode))
{
LOGC(AiLogManager::isLogging(getOwner()->getNetworkId()), "debug_ai", ("AICreatureController::equipSecondaryWeapon() owner(%s) secondaryWeapon(%s) errorCode(%d)\n", getDebugInformation().c_str(), secondaryWeaponServerObject->getDebugInformation().c_str()));
@@ -2581,7 +2581,7 @@ void AICreatureController::equipSecondaryWeapon()
GameScriptObject * const gameScriptObject = GameScriptObject::asGameScriptObject(creatureOwner);
if (gameScriptObject != NULL)
if (gameScriptObject != nullptr)
{
ScriptParams scriptParams;
scriptParams.addParam(secondaryWeaponObject->getNetworkId());
@@ -2631,7 +2631,7 @@ void AICreatureController::unEquipWeapons()
{
ServerObject * const inventory = creatureOwner->getInventory();
if (inventory != NULL)
if (inventory != nullptr)
{
Container::ContainerErrorCode error;
@@ -2648,13 +2648,13 @@ void AICreatureController::unEquipWeapons()
// Equip the default weapon
{
if (defaultWeapon != NULL)
if (defaultWeapon != nullptr)
{
creatureOwner->setCurrentWeapon(*defaultWeapon);
}
else
{
WARNING(true, ("AICreatureController::unEquipWeapons() owner(%s) NULL default weapon", getDebugInformation().c_str()));
WARNING(true, ("AICreatureController::unEquipWeapons() owner(%s) nullptr default weapon", getDebugInformation().c_str()));
}
}
}
@@ -2690,7 +2690,7 @@ bool AICreatureController::usingPrimaryWeapon()
{
WeaponObject const * const currentWeaponObject = getCreature()->getCurrentWeapon();
if (currentWeaponObject != NULL)
if (currentWeaponObject != nullptr)
{
result = (getPrimaryWeapon() == currentWeaponObject->getNetworkId());
}
@@ -2708,7 +2708,7 @@ bool AICreatureController::usingSecondaryWeapon()
{
WeaponObject const * const currentWeaponObject = getCreature()->getCurrentWeapon();
if (currentWeaponObject != NULL)
if (currentWeaponObject != nullptr)
{
result = (getSecondaryWeapon() == currentWeaponObject->getNetworkId());
}
@@ -2815,7 +2815,7 @@ void AICreatureController::setRetreating(bool const retreating)
{
CellObject const * const cellObject = CellObject::getCellObject(cellId);
if (cellObject != NULL)
if (cellObject != nullptr)
{
CellProperty const * const cellProperty = cellObject->getCellProperty();
@@ -2965,7 +2965,7 @@ time_t AICreatureController::getKnockDownRecoveryTime() const
{
AiCreatureCombatProfile const * const combatProfile = AiCreatureCombatProfile::getCombatProfile(m_aiCreatureData->m_primarySpecials);
return (combatProfile != NULL) ? combatProfile->m_knockDownRecoveryTime : 0;
return (combatProfile != nullptr) ? combatProfile->m_knockDownRecoveryTime : 0;
}
//-----------------------------------------------------------------------
std::string const AICreatureController::getCombatActionsString()
@@ -2979,7 +2979,7 @@ std::string const AICreatureController::getCombatActionsString()
{
WeaponObject const * const primaryWeaponObject = WeaponObject::getWeaponObject(getPrimaryWeapon());
if (primaryWeaponObject != NULL)
if (primaryWeaponObject != nullptr)
{
result += fs.sprintf("PRIMARY WEAPON >>> %s range[%.0f...%.0f] %s\n", FileNameUtils::get(primaryWeaponObject->getObjectTemplateName(), FileNameUtils::fileName).c_str(), primaryWeaponObject->getMinRange(), primaryWeaponObject->getMaxRange(), usingPrimaryWeapon() ? "(active)" : "");
}
@@ -2989,7 +2989,7 @@ std::string const AICreatureController::getCombatActionsString()
}
AiCreatureCombatProfile const * const primaryWeaponCombatProfile = AiCreatureCombatProfile::getCombatProfile(m_aiCreatureData->m_primarySpecials);
if (primaryWeaponCombatProfile != NULL)
if (primaryWeaponCombatProfile != nullptr)
{
result += primaryWeaponCombatProfile->toString();
}
@@ -3003,7 +3003,7 @@ std::string const AICreatureController::getCombatActionsString()
{
WeaponObject const * const secondaryWeaponObject = WeaponObject::getWeaponObject(getSecondaryWeapon());
if (secondaryWeaponObject != NULL)
if (secondaryWeaponObject != nullptr)
{
result += fs.sprintf("SECONDARY WEAPON >>> %s range[%.0f...%.0f] %s\n", FileNameUtils::get(secondaryWeaponObject->getObjectTemplateName(), FileNameUtils::fileName).c_str(), secondaryWeaponObject->getMinRange(), secondaryWeaponObject->getMaxRange(), usingSecondaryWeapon() ? "(active)" : "");
}
@@ -3014,7 +3014,7 @@ std::string const AICreatureController::getCombatActionsString()
AiCreatureCombatProfile const * const secondaryWeaponCombatProfile = AiCreatureCombatProfile::getCombatProfile(m_aiCreatureData->m_secondarySpecials);
if (secondaryWeaponCombatProfile != NULL)
if (secondaryWeaponCombatProfile != nullptr)
{
result += secondaryWeaponCombatProfile->toString();
}
@@ -127,15 +127,15 @@ AiShipController * AiShipController::getAiShipController(NetworkId const & unit)
{
Object * const object = NetworkIdManager::getObjectById(unit);
return (object != NULL) ? AiShipController::asAiShipController(object->getController()) : NULL;
return (object != nullptr) ? AiShipController::asAiShipController(object->getController()) : nullptr;
}
// ----------------------------------------------------------------------
AiShipController * AiShipController::asAiShipController(Controller * const controller)
{
ShipController * const shipController = (controller != NULL) ? controller->asShipController() : NULL;
AiShipController * const aiShipController = (shipController != NULL) ? shipController->asAiShipController() : NULL;
ShipController * const shipController = (controller != nullptr) ? controller->asShipController() : nullptr;
AiShipController * const aiShipController = (shipController != nullptr) ? shipController->asAiShipController() : nullptr;
return aiShipController;
}
@@ -144,8 +144,8 @@ AiShipController * AiShipController::asAiShipController(Controller * const contr
AiShipController const * AiShipController::asAiShipController(Controller const * const controller)
{
ShipController const * const shipController = (controller != NULL) ? controller->asShipController() : NULL;
AiShipController const * const aiShipController = (shipController != NULL) ? shipController->asAiShipController() : NULL;
ShipController const * const shipController = (controller != nullptr) ? controller->asShipController() : nullptr;
AiShipController const * const aiShipController = (shipController != nullptr) ? shipController->asAiShipController() : nullptr;
return aiShipController;
}
@@ -155,18 +155,18 @@ AiShipController const * AiShipController::asAiShipController(Controller const *
AiShipController::AiShipController(ShipObject * const owner) :
ShipController(owner),
m_pilotData(&AiShipPilotData::getDefaultPilotData()),
m_pendingNonAttackBehavior(NULL),
m_nonAttackBehavior(NULL),
m_pendingAttackBehavior(NULL),
m_attackBehavior(NULL),
m_pendingNonAttackBehavior(nullptr),
m_nonAttackBehavior(nullptr),
m_pendingAttackBehavior(nullptr),
m_attackBehavior(nullptr),
m_shipName(),
m_shipClass(ShipAiReactionManager::SC_invalid),
m_requestedSlowDown(false),
m_squad(NULL),
m_attackSquad(NULL),
m_squad(nullptr),
m_attackSquad(nullptr),
m_formationPosition_l(),
m_attackFormationPosition_l(),
m_path(NULL),
m_path(nullptr),
m_currentPathIndex(0),
m_aggroRadius(200.0f),
m_countermeasureState(CS_none),
@@ -190,22 +190,22 @@ AiShipController::~AiShipController()
// Remove this unit from its squad
if (m_squad != NULL)
if (m_squad != nullptr)
{
// The owner of the squad is SpaceSquadManager
getSquad().removeUnit(getOwner()->getNetworkId());
m_squad = NULL;
m_squad = nullptr;
}
// Remove this unit from its attack squad
if (m_attackSquad != NULL)
if (m_attackSquad != nullptr)
{
// The owner of the attack squad is SpaceSquad
m_attackSquad->removeUnit(getOwner()->getNetworkId());
m_attackSquad = NULL;
m_attackSquad = nullptr;
}
else
{
@@ -215,17 +215,17 @@ AiShipController::~AiShipController()
// Remove path here.
SpacePathManager::release(m_path, getOwner());
m_path = NULL;
m_pilotData = NULL;
m_path = nullptr;
m_pilotData = nullptr;
delete m_nonAttackBehavior;
m_nonAttackBehavior = NULL;
m_nonAttackBehavior = nullptr;
delete m_pendingNonAttackBehavior;
m_pendingNonAttackBehavior = NULL;
m_pendingNonAttackBehavior = nullptr;
delete m_pendingAttackBehavior;
m_pendingAttackBehavior = NULL;
m_pendingAttackBehavior = nullptr;
delete m_attackBehavior;
m_attackBehavior = NULL;
m_attackBehavior = nullptr;
delete m_reactToMissileTimer;
delete m_pilotManagerInfo;
delete m_exclusiveAggroSet;
@@ -234,7 +234,7 @@ AiShipController::~AiShipController()
// ----------------------------------------------------------------------
void AiShipController::endBaselines()
{
DEBUG_FATAL((m_squad != NULL), ("m_squad should be NULL"));
DEBUG_FATAL((m_squad != nullptr), ("m_squad should be nullptr"));
m_squad = SpaceSquadManager::createSquad();
getSquad().addUnit(getOwner()->getNetworkId());
@@ -252,7 +252,7 @@ float AiShipController::realAlter(float const elapsedTime)
#ifdef _DEBUG
AiDebugString * aiDebugString = NULL;
AiDebugString * aiDebugString = nullptr;
if ( s_spaceAiClientDebugEnabled
&& !getShipOwner()->getObservers().empty())
{
@@ -263,25 +263,25 @@ float AiShipController::realAlter(float const elapsedTime)
// We have to have a pending behavior because while in a behavior a trigger can get called which can then kill that behavior, so we have to wait until the next frame to switch behaviors so they don't stomp each other from triggers.
if (m_pendingNonAttackBehavior != NULL)
if (m_pendingNonAttackBehavior != nullptr)
{
delete m_nonAttackBehavior;
m_nonAttackBehavior = m_pendingNonAttackBehavior;
m_pendingNonAttackBehavior = NULL;
m_pendingNonAttackBehavior = nullptr;
}
if (m_pendingDockingBehavior != NULL)
if (m_pendingDockingBehavior != nullptr)
{
delete m_dockingBehavior;
m_dockingBehavior = m_pendingDockingBehavior;
m_pendingDockingBehavior = NULL;
m_pendingDockingBehavior = nullptr;
}
if ( (m_dockingBehavior != NULL)
if ( (m_dockingBehavior != nullptr)
&& (m_dockingBehavior->isDockFinished()))
{
delete m_dockingBehavior;
m_dockingBehavior = NULL;
m_dockingBehavior = nullptr;
}
m_yawPosition = 0.f;
@@ -292,7 +292,7 @@ float AiShipController::realAlter(float const elapsedTime)
ShipObject * const shipOwner = NON_NULL(getShipOwner());
PROFILER_AUTO_BLOCK_DEFINE("behaviors");
if (m_attackBehavior != NULL) // This was added for ships that are contructed for AI but not fully contructed proper using the space_mobile.tab
if (m_attackBehavior != nullptr) // This was added for ships that are contructed for AI but not fully contructed proper using the space_mobile.tab
{
if (isAttacking()) // Capital ships never go into attack mode as such, always follow their non-attacking behavior (although they may fire turrets as they go)
{
@@ -314,7 +314,7 @@ float AiShipController::realAlter(float const elapsedTime)
shipOwner->openWings();
}
if (m_dockingBehavior != NULL)
if (m_dockingBehavior != nullptr)
{
m_dockingBehavior->unDock();
}
@@ -325,7 +325,7 @@ float AiShipController::realAlter(float const elapsedTime)
m_attackBehavior->alter(elapsedTime);
#ifdef _DEBUG
if (aiDebugString != NULL)
if (aiDebugString != nullptr)
{
m_attackBehavior->addDebug(*aiDebugString);
}
@@ -337,9 +337,9 @@ float AiShipController::realAlter(float const elapsedTime)
Object * const leaderObject = getAttackSquad().getLeader().getObject();
ShipController * const leaderShipController = leaderObject->getController()->asShipController();
AiShipController * const leaderAiShipController = (leaderShipController != NULL) ? leaderShipController->asAiShipController() : NULL;
AiShipController * const leaderAiShipController = (leaderShipController != nullptr) ? leaderShipController->asAiShipController() : nullptr;
if (leaderAiShipController != NULL)
if (leaderAiShipController != nullptr)
{
Transform transform(leaderObject->getTransform_o2w());
transform.setPosition_p(leaderAiShipController->getMoveToGoalPosition_w());
@@ -361,7 +361,7 @@ float AiShipController::realAlter(float const elapsedTime)
{
delete m_attackBehavior;
m_attackBehavior = m_pendingAttackBehavior;
m_pendingAttackBehavior = NULL;
m_pendingAttackBehavior = nullptr;
}
}
else if (isBeingDocked())
@@ -370,18 +370,18 @@ float AiShipController::realAlter(float const elapsedTime)
setThrottle(0.0f);
}
else if (m_dockingBehavior != NULL)
else if (m_dockingBehavior != nullptr)
{
m_dockingBehavior->alter(elapsedTime);
#ifdef _DEBUG
if (aiDebugString != NULL)
if (aiDebugString != nullptr)
{
m_dockingBehavior->addDebug(*aiDebugString);
}
#endif // _DEBUG
}
else if (m_nonAttackBehavior != NULL)
else if (m_nonAttackBehavior != nullptr)
{
PROFILER_AUTO_BLOCK_DEFINE("non-attack behaviors");
@@ -413,7 +413,7 @@ float AiShipController::realAlter(float const elapsedTime)
m_nonAttackBehavior->alter(elapsedTime);
#ifdef _DEBUG
if (aiDebugString != NULL)
if (aiDebugString != nullptr)
{
m_nonAttackBehavior->addDebug(*aiDebugString);
}
@@ -425,7 +425,7 @@ float AiShipController::realAlter(float const elapsedTime)
Object * const squadLeader = getSquad().getLeader().getObject();
if (squadLeader != NULL)
if (squadLeader != nullptr)
{
Vector goalPosition_w(Formation::getPosition_w(squadLeader->getTransform_o2w(), getFormationPosition_l()));
@@ -434,9 +434,9 @@ float AiShipController::realAlter(float const elapsedTime)
if (getOwner()->getPosition_w().magnitudeBetweenSquared(goalPosition_w) > sqr(getLargestTurnRadius() * s_slowDownTurnRadiusGain))
{
ShipController * const followedUnitShipController = squadLeader->getController()->asShipController();
AiShipController * const followedUnitAiShipController = (followedUnitShipController != NULL) ? followedUnitShipController->asAiShipController() : NULL;
AiShipController * const followedUnitAiShipController = (followedUnitShipController != nullptr) ? followedUnitShipController->asAiShipController() : nullptr;
if (followedUnitAiShipController != NULL)
if (followedUnitAiShipController != nullptr)
{
followedUnitAiShipController->requestSlowDown();
}
@@ -462,7 +462,7 @@ float AiShipController::realAlter(float const elapsedTime)
}
#ifdef _DEBUG
if (aiDebugString != NULL)
if (aiDebugString != nullptr)
{
m_nonAttackBehavior->addDebug(*aiDebugString);
}
@@ -476,7 +476,7 @@ float AiShipController::realAlter(float const elapsedTime)
}
else
{
DEBUG_WARNING(true, ("debug_ai: There should never be a NULL non-attacking behavior %s", getOwner()->getDebugInformation().c_str()));
DEBUG_WARNING(true, ("debug_ai: There should never be a nullptr non-attacking behavior %s", getOwner()->getDebugInformation().c_str()));
}
}
@@ -551,8 +551,8 @@ float AiShipController::realAlter(float const elapsedTime)
}
#ifdef _DEBUG
if ( (m_attackBehavior != NULL)
&& (aiDebugString != NULL))
if ( (m_attackBehavior != nullptr)
&& (aiDebugString != nullptr))
{
PROFILER_AUTO_BLOCK_DEFINE("sendDebugAiToClients");
sendDebugAiToClients(*aiDebugString);
@@ -574,7 +574,7 @@ void AiShipController::moveTo(Vector const & position_w, float const throttle, f
// If we are not following a unit, see if we need to slow down for someone
if ( (m_nonAttackBehavior != NULL)
if ( (m_nonAttackBehavior != nullptr)
&& (m_nonAttackBehavior->getBehaviorType() != ASBT_follow)
&& m_requestedSlowDown
&& !isAttacking())
@@ -645,16 +645,16 @@ bool AiShipController::addDamageTaken(NetworkId const & attackingUnit, float con
{
ShipObject const * const attackingShipObject = ShipObject::asShipObject(NetworkIdManager::getObjectById(attackingUnit));
if (attackingShipObject != NULL)
if (attackingShipObject != nullptr)
{
CreatureObject const * const attackingPilotCreatureObject = attackingShipObject->getPilot();
if ( (attackingPilotCreatureObject != NULL)
if ( (attackingPilotCreatureObject != nullptr)
&& attackingPilotCreatureObject->isPlayerControlled())
{
GroupObject * const groupObject = attackingPilotCreatureObject->getGroup();
if (groupObject != NULL)
if (groupObject != nullptr)
{
GroupObject::GroupMemberVector const & groupMembers = groupObject->getGroupMembers();
GroupObject::GroupMemberVector::const_iterator iterGroupMembers = groupMembers.begin();
@@ -665,11 +665,11 @@ bool AiShipController::addDamageTaken(NetworkId const & attackingUnit, float con
NetworkId const & groupMemberPilotNetworkId = groupMember.first;
CreatureObject const * const groupMemberPilotCreatureObject = CreatureObject::asCreatureObject(NetworkIdManager::getObjectById(groupMemberPilotNetworkId));
if (groupMemberPilotCreatureObject != NULL)
if (groupMemberPilotCreatureObject != nullptr)
{
ShipObject const * const groupMemberShipObject = groupMemberPilotCreatureObject->getPilotedShip();
if (groupMemberShipObject != NULL)
if (groupMemberShipObject != nullptr)
{
if (groupMemberShipObject != attackingShipObject)
{
@@ -749,24 +749,24 @@ void AiShipController::follow(NetworkId const & followedUnit, Vector const & dir
LOGC(ConfigServerGame::isSpaceAiLoggingEnabled(), "debug_ai", ("AiShipController::follow() owner(%s) followedUnit(%s) direction_o(%.1f, %.1f, %.1f) offset(%.1f)", getOwner()->getNetworkId().getValueString().c_str(), followedUnit.getValueString().c_str(), direction_l.x, direction_l.y, direction_l.z, distance));
SpacePathManager::release(m_path, getOwner());
m_path = NULL;
m_path = nullptr;
float appearanceRadius = 0.0f;
Object const * const followedObject = NetworkIdManager::getObjectById(followedUnit);
if (followedObject != NULL)
if (followedObject != nullptr)
{
//-- This needs to be improved to cast a ray from this position back towards the ship and get the actual collision position
CollisionProperty const * const ownerCollisionProperty = getOwner()->getCollisionProperty();
CollisionProperty const * const followedObjectCollisionProperty = followedObject->getCollisionProperty();
if (ownerCollisionProperty != NULL)
if (ownerCollisionProperty != nullptr)
{
appearanceRadius += ownerCollisionProperty->getBoundingSphere_l().getRadius();
}
if (followedObjectCollisionProperty != NULL)
if (followedObjectCollisionProperty != nullptr)
{
appearanceRadius += followedObjectCollisionProperty ->getBoundingSphere_l().getRadius();
}
@@ -786,7 +786,7 @@ int AiShipController::getBehaviorType() const
{
AiShipBehaviorType result = ASBT_idle;
if (m_nonAttackBehavior != NULL)
if (m_nonAttackBehavior != nullptr)
{
result = m_nonAttackBehavior->getBehaviorType();
}
@@ -803,7 +803,7 @@ void AiShipController::idle()
LOGC(ConfigServerGame::isSpaceAiLoggingEnabled(), "debug_ai", ("AiShipController::idle() owner(%s)", getOwner()->getNetworkId().getValueString().c_str()));
SpacePathManager::release(m_path, getOwner());
m_path = NULL;
m_path = nullptr;
delete m_pendingNonAttackBehavior;
m_pendingNonAttackBehavior = new AiShipBehaviorIdle(*this);;
@@ -818,7 +818,7 @@ void AiShipController::track(Object const & target)
LOGC(ConfigServerGame::isSpaceAiLoggingEnabled(), "debug_ai", ("AiShipController::track() owner(%s) target(%s)", getOwner()->getNetworkId().getValueString().c_str(), target.getNetworkId().getValueString().c_str()));
SpacePathManager::release(m_path, getOwner());
m_path = NULL;
m_path = nullptr;
delete m_pendingNonAttackBehavior;
m_pendingNonAttackBehavior = new AiShipBehaviorTrack(*this, target);
@@ -871,7 +871,7 @@ void AiShipController::clearPatrolPath()
{
LOGC(ConfigServerGame::isSpaceAiLoggingEnabled(), "debug_ai", ("AiShipController::clearPatrolPath() owner(%s)", getOwner()->getNetworkId().getValueString().c_str()));
if (m_path != NULL)
if (m_path != nullptr)
{
m_path->clear();
}
@@ -896,15 +896,15 @@ void AiShipController::triggerBehaviorChanged(AiShipBehaviorType const newBehavi
{
// Only send the trigger if the new behavior is different from the old behavior
AiShipBehaviorType const oldBehavior = (m_nonAttackBehavior != NULL) ? m_nonAttackBehavior->getBehaviorType() : ASBT_idle;
AiShipBehaviorType const oldBehavior = (m_nonAttackBehavior != nullptr) ? m_nonAttackBehavior->getBehaviorType() : ASBT_idle;
if (oldBehavior != newBehavior)
{
Object * const object = getOwner();
ServerObject * const serverObject = (object != NULL) ? object->asServerObject() : NULL;
GameScriptObject * const gameScriptObject = (serverObject != NULL) ? serverObject->getScriptObject() : NULL;
ServerObject * const serverObject = (object != nullptr) ? object->asServerObject() : nullptr;
GameScriptObject * const gameScriptObject = (serverObject != nullptr) ? serverObject->getScriptObject() : nullptr;
if (gameScriptObject != NULL)
if (gameScriptObject != nullptr)
{
LOGC(ConfigServerGame::isSpaceAiLoggingEnabled(), "debug_ai", ("AiShipController::triggerBehaviorChanged() unit(%s) old(%s) new(%s)", getOwner()->getNetworkId().getValueString().c_str(), AiShipBehaviorBase::getBehaviorString(oldBehavior), AiShipBehaviorBase::getBehaviorString(newBehavior)));
@@ -925,10 +925,10 @@ void AiShipController::triggerBehaviorChanged(AiShipBehaviorType const newBehavi
void AiShipController::triggerEnterCombat(NetworkId const & attackTarget)
{
Object * const object = getOwner();
ServerObject * const serverObject = (object != NULL) ? object->asServerObject() : NULL;
GameScriptObject * const gameScriptObject = (serverObject != NULL) ? serverObject->getScriptObject() : NULL;
ServerObject * const serverObject = (object != nullptr) ? object->asServerObject() : nullptr;
GameScriptObject * const gameScriptObject = (serverObject != nullptr) ? serverObject->getScriptObject() : nullptr;
if (gameScriptObject != NULL)
if (gameScriptObject != nullptr)
{
LOGC(ConfigServerGame::isSpaceAiLoggingEnabled(), "debug_ai", ("AiShipController::triggerEnterCombat() unit(%s) attackTarget(%s)", getOwner()->getNetworkId().getValueString().c_str(), attackTarget.getValueString().c_str()));
@@ -968,7 +968,7 @@ void AiShipController::setPilotType(std::string const & pilotType)
AiPilotManager::getPilotData(*m_pilotData, *m_pilotManagerInfo);
// Make sure the ship name is set
if (shipObject != NULL)
if (shipObject != nullptr)
{
std::string shipName;
@@ -986,7 +986,7 @@ void AiShipController::setPilotType(std::string const & pilotType)
// Create the attack behavior based on the ship class
delete m_attackBehavior;
m_attackBehavior = NULL;
m_attackBehavior = nullptr;
m_shipClass = ShipAiReactionManager::getShipClass(m_shipName);
@@ -1009,7 +1009,7 @@ void AiShipController::setPilotType(std::string const & pilotType)
setAggroRadius(m_pilotData->m_aggroRadius);
FATAL((m_attackBehavior == NULL), ("The attack behavior can not be NULL."));
FATAL((m_attackBehavior == nullptr), ("The attack behavior can not be nullptr."));
}
// ----------------------------------------------------------------------
@@ -1029,8 +1029,8 @@ CachedNetworkId const & AiShipController::getPrimaryAttackTarget() const
ShipObject const * AiShipController::getPrimaryAttackTargetShipObject() const
{
Object const * const targetObject = getPrimaryAttackTarget().getObject();
ServerObject const * const targetServerObject = (targetObject != NULL) ? targetObject->asServerObject() : NULL;
ShipObject const * const targetShipObject = (targetServerObject != NULL) ? targetServerObject->asShipObject() : NULL;
ServerObject const * const targetServerObject = (targetObject != nullptr) ? targetObject->asServerObject() : nullptr;
ShipObject const * const targetShipObject = (targetServerObject != nullptr) ? targetServerObject->asShipObject() : nullptr;
return targetShipObject;
}
@@ -1097,7 +1097,7 @@ void AiShipController::setSquad(SpaceSquad * const squad)
{
// Remove the unit from its previous squad
if ( (m_squad != NULL)
if ( (m_squad != nullptr)
&& !m_squad->isEmpty())
{
m_squad->removeUnit(getOwner()->getNetworkId());
@@ -1170,7 +1170,7 @@ void AiShipController::setAttackSquad(SpaceAttackSquad * const attackSquad)
{
// Remove the unit from its pervious attack squad
if (m_attackSquad != NULL)
if (m_attackSquad != nullptr)
{
m_attackSquad->removeUnit(getOwner()->getNetworkId());
}
@@ -1210,7 +1210,7 @@ float AiShipController::getShipRadius() const
ShipObject const * const shipObject = getShipOwner();
CollisionProperty const * const shipCollision = shipObject->getCollisionProperty();
if (shipCollision != NULL)
if (shipCollision != nullptr)
{
result = shipCollision->getBoundingSphere_l().getRadius();
}
@@ -1288,9 +1288,9 @@ bool AiShipController::shouldCheckForEnemies() const
void AiShipController::setCurrentPathIndex(unsigned int const index)
{
//LOGC(ConfigServerGame::isSpaceAiLoggingEnabled(), "debug_ai", ("AiShipController::setCurrentPathIndex() unit(%s) pathIndex(%u) pathSize(%u)", getOwner()->getNetworkId().getValueString().c_str(), index, (m_path != NULL) ? m_path->getTransformList().size() : 0));
//LOGC(ConfigServerGame::isSpaceAiLoggingEnabled(), "debug_ai", ("AiShipController::setCurrentPathIndex() unit(%s) pathIndex(%u) pathSize(%u)", getOwner()->getNetworkId().getValueString().c_str(), index, (m_path != nullptr) ? m_path->getTransformList().size() : 0));
if ( (m_path != NULL)
if ( (m_path != nullptr)
&& !m_path->isEmpty())
{
m_currentPathIndex = index;
@@ -1298,7 +1298,7 @@ void AiShipController::setCurrentPathIndex(unsigned int const index)
else
{
m_currentPathIndex = 0;
LOGC(ConfigServerGame::isSpaceAiLoggingEnabled() && (m_currentPathIndex > 0), "debug_ai", ("AiShipController::setCurrentPathIndex() Setting a non-zero path index(%d) on a NULL or empty path", index));
LOGC(ConfigServerGame::isSpaceAiLoggingEnabled() && (m_currentPathIndex > 0), "debug_ai", ("AiShipController::setCurrentPathIndex() Setting a non-zero path index(%d) on a nullptr or empty path", index));
}
}
@@ -1317,7 +1317,7 @@ float AiShipController::calculateThrottleToPosition_w(Vector const & position_w,
Object const * const object = getOwner();
if (object != NULL)
if (object != nullptr)
{
float const distanceToGoalSquared = object->getPosition_w().magnitudeBetweenSquared(position_w);
@@ -1420,7 +1420,7 @@ void AiShipController::switchToBomberAttack()
bool AiShipController::removeAttackTarget(NetworkId const & unit)
{
LOGC(ConfigServerGame::isSpaceAiLoggingEnabled(), "debug_ai", ("AiShipController::removeAttackTarget() owner(%s) unit(%s)", getOwner()->getNetworkId().getValueString().c_str(), unit.getValueString().c_str()));
DEBUG_WARNING((unit == NetworkId::cms_invalid), ("debug_ai: owner(%s) ERROR: Trying to remove a NULL unit(%s) from the attack target list.", getOwner()->getNetworkId().getValueString().c_str(), unit.getValueString().c_str()));
DEBUG_WARNING((unit == NetworkId::cms_invalid), ("debug_ai: owner(%s) ERROR: Trying to remove a nullptr unit(%s) from the attack target list.", getOwner()->getNetworkId().getValueString().c_str(), unit.getValueString().c_str()));
return ShipController::removeAttackTarget(unit);
}
@@ -1637,7 +1637,7 @@ void AiShipController::sendDebugAiToClients(AiDebugString & aiDebugString)
bool const checkForEnemies = shouldCheckForEnemies();
float const leashRadius = m_attackBehavior->getLeashRadius();
aiDebugString.addText(formattedString.sprintf("%s agg(%.0f) lsh(%.0f) %s\n", AiShipController::getAttackOrdersString(getAttackOrders()), m_aggroRadius, leashRadius, (m_attackBehavior == NULL) ? " [NO ATTACK BEHAVIOR]" : (checkForEnemies ? " [LFE]" : "")));
aiDebugString.addText(formattedString.sprintf("%s agg(%.0f) lsh(%.0f) %s\n", AiShipController::getAttackOrdersString(getAttackOrders()), m_aggroRadius, leashRadius, (m_attackBehavior == nullptr) ? " [NO ATTACK BEHAVIOR]" : (checkForEnemies ? " [LFE]" : "")));
}
}
@@ -1687,7 +1687,7 @@ void AiShipController::sendDebugAiToClients(AiDebugString & aiDebugString)
// Only send to the client if the objvar is set
int temp = 0;
if ( (characterObject != NULL)
if ( (characterObject != nullptr)
&& characterObject->getObjVars().getItem("ai_debug_string", temp))
{
if (temp > 0)
@@ -1768,8 +1768,8 @@ void AiShipController::addExclusiveAggro(NetworkId const & unit)
// Make sure this is a player
Object * const unitObject = NetworkIdManager::getObjectById(unit);
ServerObject * const unitServerObject = (unitObject != NULL) ? unitObject->asServerObject() : NULL;
CreatureObject * const unitCreatureObject = (unitServerObject != NULL) ? unitServerObject->asCreatureObject() : NULL;
ServerObject * const unitServerObject = (unitObject != nullptr) ? unitObject->asServerObject() : nullptr;
CreatureObject * const unitCreatureObject = (unitServerObject != nullptr) ? unitServerObject->asCreatureObject() : nullptr;
if ( !unitCreatureObject
|| !unitCreatureObject->isPlayerControlled())
@@ -1829,11 +1829,11 @@ bool AiShipController::isExclusiveAggro(CreatureObject const & pilot) const
CreatureObject const * const aggroCreatureObject = CreatureObject::asCreatureObject(aggroCachedNetworkId.getObject());
if (aggroCreatureObject != NULL)
if (aggroCreatureObject != nullptr)
{
GroupObject * const groupObject = aggroCreatureObject->getGroup();
if (groupObject != NULL)
if (groupObject != nullptr)
{
GroupObject::GroupMemberVector const & groupMembers = groupObject->getGroupMembers();
GroupObject::GroupMemberVector::const_iterator iterGroupMembers = groupMembers.begin();
@@ -1871,7 +1871,7 @@ bool AiShipController::isValidTarget(ShipObject const & unit) const
CreatureObject const * const pilotCreatureObject = unit.getPilot();
if (pilotCreatureObject != NULL)
if (pilotCreatureObject != nullptr)
{
if (pilotCreatureObject->isPlayerControlled())
{
@@ -25,7 +25,7 @@ bool AiShipControllerInterface::addDamageTaken(NetworkId const & unit, NetworkId
bool result = false;
AiShipController * const aiShipController = AiShipController::getAiShipController(unit);
if (aiShipController != NULL)
if (aiShipController != nullptr)
{
bool const verifyAttacker = false;
@@ -45,7 +45,7 @@ bool AiShipControllerInterface::setAttackOrders(NetworkId const & unit, AiShipCo
bool result = false;
AiShipController * const aiShipController = AiShipController::getAiShipController(unit);
if (aiShipController != NULL)
if (aiShipController != nullptr)
{
result = true;
aiShipController->setAttackOrders(attackOrders);
@@ -64,7 +64,7 @@ bool AiShipControllerInterface::idle(NetworkId const & unit)
bool result = false;
AiShipController * const aiShipController = AiShipController::getAiShipController(unit);
if (aiShipController != NULL)
if (aiShipController != nullptr)
{
result = true;
aiShipController->idle();
@@ -83,7 +83,7 @@ bool AiShipControllerInterface::track(NetworkId const & unit, Object const & tar
bool result = false;
AiShipController * const aiShipController = AiShipController::getAiShipController(unit);
if (aiShipController != NULL)
if (aiShipController != nullptr)
{
result = true;
aiShipController->track(target);
@@ -102,7 +102,7 @@ bool AiShipControllerInterface::setLeashRadius(NetworkId const & unit, float con
bool result = false;
AiShipController * const aiShipController = AiShipController::getAiShipController(unit);
if (aiShipController != NULL)
if (aiShipController != nullptr)
{
result = true;
aiShipController->setLeashRadius(radius);
@@ -121,7 +121,7 @@ bool AiShipControllerInterface::follow(NetworkId const & unit, NetworkId const &
bool result = false;
AiShipController * const aiShipController = AiShipController::getAiShipController(unit);
if (aiShipController != NULL)
if (aiShipController != nullptr)
{
result = true;
aiShipController->follow(followedUnit, direction_o, direction);
@@ -140,7 +140,7 @@ bool AiShipControllerInterface::addPatrolPath(NetworkId const & unit, SpacePath
bool result = false;
AiShipController * const aiShipController = AiShipController::getAiShipController(unit);
if (aiShipController != NULL)
if (aiShipController != nullptr)
{
result = true;
aiShipController->addPatrolPath(path);
@@ -159,7 +159,7 @@ bool AiShipControllerInterface::clearPatrolPath(NetworkId const & unit)
bool result = false;
AiShipController * const aiShipController = AiShipController::getAiShipController(unit);
if (aiShipController != NULL)
if (aiShipController != nullptr)
{
result = true;
aiShipController->clearPatrolPath();
@@ -178,7 +178,7 @@ bool AiShipControllerInterface::moveTo(NetworkId const & unit, SpacePath * const
bool result = false;
AiShipController * const aiShipController = AiShipController::getAiShipController(unit);
if (aiShipController != NULL)
if (aiShipController != nullptr)
{
result = true;
aiShipController->moveTo(path);
@@ -122,7 +122,7 @@ CreatureController::~CreatureController()
void CreatureController::handleMessage (const int message, const float value, const MessageQueue::Data* const data, const uint32 flags)
{
CreatureObject * const owner = static_cast<CreatureObject*>(getOwner());
DEBUG_FATAL(!owner, ("Owner is NULL in CreatureController::handleMessage\n"));
DEBUG_FATAL(!owner, ("Owner is nullptr in CreatureController::handleMessage\n"));
switch(message)
{
@@ -629,7 +629,7 @@ void CreatureController::handleMessage (const int message, const float value, co
case CM_setIncapacitated:
{
const MessageQueueGenericValueType<std::pair<bool, NetworkId> > * const msg = safe_cast<const MessageQueueGenericValueType<std::pair<bool, NetworkId> > *>(data);
if (msg != NULL)
if (msg != nullptr)
owner->setIncapacitated(msg->getValue().first, msg->getValue().second);
}
break;
@@ -853,7 +853,7 @@ void CreatureController::handleMessage (const int message, const float value, co
if (owner && msg)
owner->setAlternateAppearance(msg->getValue());
else
WARNING(true, ("CreatureController: received CM_setAppearanceFromObjectTemplate but owner or message was NULL."));
WARNING(true, ("CreatureController: received CM_setAppearanceFromObjectTemplate but owner or message was nullptr."));
}
break;
@@ -873,9 +873,9 @@ void CreatureController::handleMessage (const int message, const float value, co
if (msg)
{
ServerObject * defender = safe_cast<ServerObject *>(NetworkIdManager::getObjectById(msg->getDefender()));
if (defender != NULL)
if (defender != nullptr)
{
if (defender->asCreatureObject() != NULL)
if (defender->asCreatureObject() != nullptr)
{
defender->asCreatureObject()->pushedMe(msg->getAttacker(), msg->getAttackerPos(), msg->getDefenderPos(), msg->getDistance());
}
@@ -894,7 +894,7 @@ void CreatureController::handleMessage (const int message, const float value, co
if (msg)
{
ServerObject * target = safe_cast<ServerObject *>(NetworkIdManager::getObjectById(msg->getTarget()));
if (target != NULL && target->asTangibleObject() != NULL)
if (target != nullptr && target->asTangibleObject() != nullptr)
{
if (owner->isAuthoritative())
owner->addSlowDownEffect(*(target->asTangibleObject()), msg->getConeLength(), msg->getConeAngle(), msg->getSlopeAngle(), msg->getExpireTime());
@@ -964,7 +964,7 @@ void CreatureController::handleMessage (const int message, const float value, co
{
MessageQueueCyberneticsChangeRequest const * const msg = safe_cast<MessageQueueCyberneticsChangeRequest const *>(data);
NOT_NULL(msg);
if (msg != NULL)
if (msg != nullptr)
{
NetworkId const & playerId = msg->getTarget();
GameScriptObject * const scriptObject = owner->getScriptObject();
@@ -984,10 +984,10 @@ void CreatureController::handleMessage (const int message, const float value, co
case CM_setCurrentQuest:
{
MessageQueueGenericValueType<uint32> const * const msg = safe_cast<MessageQueueGenericValueType<uint32> const *>(data);
if (msg != NULL)
if (msg != nullptr)
{
PlayerObject * player = PlayerCreatureController::getPlayerObject(owner);
if (player != NULL)
if (player != nullptr)
{
player->setCurrentQuest(msg->getValue());
}
@@ -1003,7 +1003,7 @@ void CreatureController::handleMessage (const int message, const float value, co
case CM_setRegenRate:
{
MessageQueueGenericValueType<std::pair<int, float> > const * const msg = safe_cast<MessageQueueGenericValueType<std::pair<int, float> > const *>(data);
if (msg != NULL)
if (msg != nullptr)
{
owner->setRegenRate(static_cast<Attributes::Enumerator>(msg->getValue().first), msg->getValue().second);
}
@@ -1516,7 +1516,7 @@ void CreatureController::conclude()
// combatants must be adjusted to reflect the server's idea of the post-alter end posture.
// This information was not known at the time the message was constructed.
MessageQueueCombatAction * combatMessage = safe_cast<MessageQueueCombatAction *>(data);
if (combatMessage != NULL)
if (combatMessage != nullptr)
{
//-- Fix up end postures in messages.
@@ -1527,7 +1527,7 @@ void CreatureController::conclude()
combatMessage->getAttacker());
const CreatureObject * attacker = dynamic_cast<const CreatureObject *>(
NetworkIdManager::getObjectById(attackerData.id));
attackerData.endPosture = (attacker != NULL) ? attacker->getPosture() : static_cast<Postures::Enumerator>(0);
attackerData.endPosture = (attacker != nullptr) ? attacker->getPosture() : static_cast<Postures::Enumerator>(0);
// set the defenders' posture
const MessageQueueCombatAction::DefenderDataVector & defenderData =
@@ -1539,7 +1539,7 @@ void CreatureController::conclude()
const_cast<MessageQueueCombatAction::DefenderData &>(*iter);
const CreatureObject * defender = dynamic_cast<const CreatureObject *>(
NetworkIdManager::getObjectById(defenderData.id));
defenderData.endPosture = (defender != NULL) ? defender->getPosture() : static_cast<Postures::Enumerator>(0);
defenderData.endPosture = (defender != nullptr) ? defender->getPosture() : static_cast<Postures::Enumerator>(0);
}
}
}
@@ -1667,7 +1667,7 @@ void CreatureController::handleSecureTradeMessage(const MessageQueueSecureTrade
));
}
}
else if (recipient->getClient() == NULL)
else if (recipient->getClient() == nullptr)
{
// GameServer::getInstance().sendToPlanetServer(
// GenericValueTypeMessage<std::pair<NetworkId, NetworkId> >(
@@ -1862,7 +1862,7 @@ void CreatureController::setAppearanceFromObjectTemplate(std::string const &serv
CreatureObject * owner = dynamic_cast<CreatureObject *>(getOwner());
if (!owner)
{
WARNING(true, ("setAppearanceFromObjectTemplate(): owner is NULL or not a CreatureObject."));
WARNING(true, ("setAppearanceFromObjectTemplate(): owner is nullptr or not a CreatureObject."));
return;
}
@@ -2007,7 +2007,7 @@ void CreatureController::calculateWaterState(bool& isSwimming, bool &isBurning,
if (ownerCreature->getState(States::RidingMount))
{
CreatureObject const *const mountCreature = ownerCreature->getMountedCreature();
CreatureController const *const mountCreatureController = mountCreature ? safe_cast<CreatureController const*>(mountCreature->getController()) : NULL;
CreatureController const *const mountCreatureController = mountCreature ? safe_cast<CreatureController const*>(mountCreature->getController()) : nullptr;
if (mountCreatureController)
{
// Note: we do the real computation for the mount here because the rider gets
@@ -2135,28 +2135,28 @@ CreatureController const * CreatureController::asCreatureController() const
PlayerCreatureController * CreatureController::asPlayerCreatureController()
{
return NULL;
return nullptr;
}
//----------------------------------------------------------------------
PlayerCreatureController const * CreatureController::asPlayerCreatureController() const
{
return NULL;
return nullptr;
}
//----------------------------------------------------------------------
AICreatureController * CreatureController::asAiCreatureController()
{
return NULL;
return nullptr;
}
//----------------------------------------------------------------------
AICreatureController const * CreatureController::asAiCreatureController() const
{
return NULL;
return nullptr;
}
//-----------------------------------------------------------------------
@@ -2170,23 +2170,23 @@ CreatureController * CreatureController::getCreatureController(NetworkId const &
CreatureController * CreatureController::getCreatureController(Object * object)
{
Controller * controller = (object != NULL) ? object->getController() : NULL;
Controller * controller = (object != nullptr) ? object->getController() : nullptr;
return (controller != NULL) ? controller->asCreatureController() : NULL;
return (controller != nullptr) ? controller->asCreatureController() : nullptr;
}
// ----------------------------------------------------------------------
CreatureController * CreatureController::asCreatureController(Controller * controller)
{
return (controller != NULL) ? controller->asCreatureController() : NULL;
return (controller != nullptr) ? controller->asCreatureController() : nullptr;
}
// ----------------------------------------------------------------------
CreatureController const * CreatureController::asCreatureController(Controller const * controller)
{
return (controller != NULL) ? controller->asCreatureController() : NULL;
return (controller != nullptr) ? controller->asCreatureController() : nullptr;
}
// ======================================================================
@@ -61,7 +61,7 @@ void PlanetController::handleMessage (const int message, const float value, cons
case CM_setWeather:
{
const MessageQueueGenericValueType<std::pair<int, Vector> >* const message = safe_cast<const MessageQueueGenericValueType<std::pair<int, Vector> >*> (data);
if (message != NULL)
if (message != nullptr)
{
owner->setWeather(
message->getValue().first,
@@ -280,7 +280,7 @@ void PlanetController::handleMessage (const int message, const float value, cons
const std::map<std::string, int64> & data = message->getValue();
for (std::map<std::string, int64>::const_iterator iter = data.begin(); iter != data.end(); ++iter)
owner->adjustGcwImperialScore("CM_adjustGcwImperialScore", NULL, iter->first, iter->second);
owner->adjustGcwImperialScore("CM_adjustGcwImperialScore", nullptr, iter->first, iter->second);
}
}
break;
@@ -293,7 +293,7 @@ void PlanetController::handleMessage (const int message, const float value, cons
const std::map<std::string, int64> & data = message->getValue();
for (std::map<std::string, int64>::const_iterator iter = data.begin(); iter != data.end(); ++iter)
owner->adjustGcwRebelScore("CM_adjustGcwRebelScore", NULL, iter->first, iter->second);
owner->adjustGcwRebelScore("CM_adjustGcwRebelScore", nullptr, iter->first, iter->second);
}
}
break;
@@ -164,7 +164,7 @@ namespace PlayerCreatureControllerNamespace
if(!mount)
{
LOG("mounts-bug", ("PlayerCreatureControllerNamespace::isCreaturePassenger(): server id=[%d],object id=[%s] creature has state RidingMount but getMountedCreature() returns NULL.", static_cast<int>(GameServer::getInstance().getProcessId()), creature.getNetworkId().getValueString().c_str()));
LOG("mounts-bug", ("PlayerCreatureControllerNamespace::isCreaturePassenger(): server id=[%d],object id=[%s] creature has state RidingMount but getMountedCreature() returns nullptr.", static_cast<int>(GameServer::getInstance().getProcessId()), creature.getNetworkId().getValueString().c_str()));
return false;
}
@@ -172,7 +172,7 @@ namespace PlayerCreatureControllerNamespace
if(!primaryRider)
{
LOG("mounts-bug", ("PlayerCreatureControllerNamespace::isCreaturePassenger(): server id=[%d],object id=[%s] creature has state RidingMount but mount->getPrimaryMountingRider() returns NULL.", static_cast<int>(GameServer::getInstance().getProcessId()), creature.getNetworkId().getValueString().c_str()));
LOG("mounts-bug", ("PlayerCreatureControllerNamespace::isCreaturePassenger(): server id=[%d],object id=[%s] creature has state RidingMount but mount->getPrimaryMountingRider() returns nullptr.", static_cast<int>(GameServer::getInstance().getProcessId()), creature.getNetworkId().getValueString().c_str()));
return false;
}
@@ -411,7 +411,7 @@ void PlayerCreatureController::logMoveFailed(char const *reason)
"movement",
(
"move fail - object %s stationId %u - %s",
creature ? creature->getNetworkId().getValueString().c_str() : "<null>",
creature ? creature->getNetworkId().getValueString().c_str() : "<nullptr>",
stationId,
reason));
}
@@ -425,7 +425,7 @@ bool PlayerCreatureController::isLocationValid(Vector const &position_w, CellObj
return false;
TerrainObject const *const terrainObject = TerrainObject::getConstInstance();
if (NULL != terrainObject && (NULL == cell || cell->getCellProperty()->isWorldCell()))
if (nullptr != terrainObject && (nullptr == cell || cell->getCellProperty()->isWorldCell()))
{
if (!terrainObject->isPassableForceChunkCreation(position_w))
return false;
@@ -445,7 +445,7 @@ bool PlayerCreatureController::isLocationValid(Vector const &position_w, CellObj
Sphere testSphere(position_w + localSphere.getCenter(), localSphere.getRadius());
if (CollisionWorld::query(testSphere, NULL))
if (CollisionWorld::query(testSphere, nullptr))
return false;
}
return true;
@@ -464,7 +464,7 @@ bool PlayerCreatureController::checkValidMove(MoveSnapshot const &m, float const
CreatureObject * const creature = NON_NULL(getCreature());
// update the velocity in the serverController
if (creature != NULL)
if (creature != nullptr)
{
Vector moveDistance = m.getPosition_w() - creature->getPosition_w();
moveDistance.y = 0.0f;
@@ -495,8 +495,8 @@ bool PlayerCreatureController::checkValidMove(MoveSnapshot const &m, float const
if (!m.isValid())
return handleInvalidMove("invalid destination");
if (creature == NULL)
return handleInvalidMove("creature is null");
if (creature == nullptr)
return handleInvalidMove("creature is nullptr");
if (!m.isAllowed(*creature))
return handleInvalidMove("not allowed in dest cell");
@@ -513,7 +513,7 @@ bool PlayerCreatureController::checkValidMove(MoveSnapshot const &m, float const
PortalProperty const *destPortalProperty = destCell ? ContainerInterface::getContainedByObject(*destCell)->getPortalProperty() : 0;
if (sourcePortalProperty != destPortalProperty)
{
// Moving between pobs. This is only valid if one of these is null, since pobs only connect to the world
// Moving between pobs. This is only valid if one of these is nullptr, since pobs only connect to the world
if (sourcePortalProperty && destPortalProperty)
return handleInvalidMove("tried to move from one pob to another without passing through the world cell");
if (sourcePortalProperty && !sourcePortalProperty->hasPassablePortalToParentCell())
@@ -548,7 +548,7 @@ bool PlayerCreatureController::checkValidMove(MoveSnapshot const &m, float const
Client * const client = creature->getClient();
if (!client)
return handleInvalidMove("Creature's client is NULL");
return handleInvalidMove("Creature's client is nullptr");
uint32 const currentServerSyncStamp = client->getServerSyncStampLong();
@@ -741,7 +741,7 @@ bool PlayerCreatureController::checkValidMove(MoveSnapshot const &m, float const
}
m_lastSpeedCheckFailureTime = ::time(NULL);
m_lastSpeedCheckFailureTime = ::time(nullptr);
++m_speedCheckConsecutiveFailureCount;
// if this is the first validation failure "in a while", let it pass, because it may be a false positive
@@ -1153,11 +1153,11 @@ void PlayerCreatureController::handleMessage (const int message, const float val
NetworkId const & designerId = inMsg->getDesignerId();
NetworkId const & recipientId = inMsg->getRecipientId();
Object const * const designerObj = NetworkIdManager::getObjectById(designerId);
ServerObject const * const designerServer = designerObj ? designerObj->asServerObject() : NULL;
CreatureObject const * const designer = designerServer ? designerServer->asCreatureObject() : NULL;
ServerObject const * const designerServer = designerObj ? designerObj->asServerObject() : nullptr;
CreatureObject const * const designer = designerServer ? designerServer->asCreatureObject() : nullptr;
Object * const recipientObj = NetworkIdManager::getObjectById(recipientId);
ServerObject * const recipientServer = recipientObj ? recipientObj->asServerObject() : NULL;
CreatureObject * const recipient = recipientServer ? recipientServer->asCreatureObject() : NULL;
ServerObject * const recipientServer = recipientObj ? recipientObj->asServerObject() : nullptr;
CreatureObject * const recipient = recipientServer ? recipientServer->asCreatureObject() : nullptr;
if(designer && recipient)
{
//designer-sent message, either data to sync to the recipient, or committed data to check and apply
@@ -1167,7 +1167,7 @@ void PlayerCreatureController::handleMessage (const int message, const float val
{
//designer hasn't accepted yet, send change to the client so they can see it before agreeing
Object * const recipientObject = NetworkIdManager::getObjectById(inMsg->getRecipientId());
Controller * const recipientController = recipientObject ? recipientObject->getController() : NULL;
Controller * const recipientController = recipientObject ? recipientObject->getController() : nullptr;
if(recipientController)
{
ImageDesignChangeMessage * outMsg = new ImageDesignChangeMessage();
@@ -1182,7 +1182,7 @@ void PlayerCreatureController::handleMessage (const int message, const float val
{
//check and apply this data once the recipient also accepts
Object * const recipientObject = NetworkIdManager::getObjectById(inMsg->getRecipientId());
Controller * const recipientController = recipientObject ? recipientObject->getController() : NULL;
Controller * const recipientController = recipientObject ? recipientObject->getController() : nullptr;
if(recipientController)
{
ImageDesignChangeMessage * outMsg = new ImageDesignChangeMessage();
@@ -1201,7 +1201,7 @@ void PlayerCreatureController::handleMessage (const int message, const float val
//recipient hasn't accepted yet, send the data to the designer to update the recipient-sent amount of money
//designer hasn't accepted yet, send change to the client so they can see it before agreeing
Object * const designerObject = NetworkIdManager::getObjectById(inMsg->getDesignerId());
Controller * const designerController = designerObject ? designerObject->getController() : NULL;
Controller * const designerController = designerObject ? designerObject->getController() : nullptr;
if(designerController)
{
ImageDesignChangeMessage * outMsg = new ImageDesignChangeMessage();
@@ -1232,8 +1232,8 @@ void PlayerCreatureController::handleMessage (const int message, const float val
std::string const recipientSpeciesGender = CustomizationManager::getServerSpeciesGender(*recipient);
CustomizationData * const customizationData = recipient->fetchCustomizationData();
ServerObject * const hair = recipient->getHair();
TangibleObject * const tangibleHair = hair ? hair->asTangibleObject() : NULL;
CustomizationData * customizationDataHair = NULL;
TangibleObject * const tangibleHair = hair ? hair->asTangibleObject() : nullptr;
CustomizationData * customizationDataHair = nullptr;
if(tangibleHair)
customizationDataHair = tangibleHair->fetchCustomizationData();
if(customizationData)
@@ -1285,7 +1285,7 @@ void PlayerCreatureController::handleMessage (const int message, const float val
{
//if the recipient canceled the session, tell the designer
Object const * const designerObject = NetworkIdManager::getObjectById(session.designerId);
ServerObject const * const designer = designerObject ? designerObject->asServerObject() : NULL;
ServerObject const * const designer = designerObject ? designerObject->asServerObject() : nullptr;
if(designer && (owner->getNetworkId() != session.designerId))
Chat::sendSystemMessage(*designer, SharedStringIds::imagedesigner_canceled_by_recip, Unicode::emptyString);
@@ -1304,11 +1304,11 @@ void PlayerCreatureController::handleMessage (const int message, const float val
NetworkId const & bufferId = inMsg->getBufferId();
NetworkId const & recipientId = inMsg->getRecipientId();
Object const * const bufferObj = NetworkIdManager::getObjectById(bufferId);
ServerObject const * const bufferServer = bufferObj ? bufferObj->asServerObject() : NULL;
CreatureObject const * const buffer = bufferServer ? bufferServer->asCreatureObject() : NULL;
ServerObject const * const bufferServer = bufferObj ? bufferObj->asServerObject() : nullptr;
CreatureObject const * const buffer = bufferServer ? bufferServer->asCreatureObject() : nullptr;
Object * const recipientObj = NetworkIdManager::getObjectById(recipientId);
ServerObject * const recipientServer = recipientObj ? recipientObj->asServerObject() : NULL;
CreatureObject * const recipient = recipientServer ? recipientServer->asCreatureObject() : NULL;
ServerObject * const recipientServer = recipientObj ? recipientObj->asServerObject() : nullptr;
CreatureObject * const recipient = recipientServer ? recipientServer->asCreatureObject() : nullptr;
if(buffer && recipient)
{
//buffer-sent message, either data to sync to the recipient, or committed data to check and apply
@@ -1318,7 +1318,7 @@ void PlayerCreatureController::handleMessage (const int message, const float val
{
//buffer hasn't accepted yet, send change to the client so they can see it before agreeing
Object * const recipientObject = NetworkIdManager::getObjectById(inMsg->getRecipientId());
Controller * const recipientController = recipientObject ? recipientObject->getController() : NULL;
Controller * const recipientController = recipientObject ? recipientObject->getController() : nullptr;
if(recipientController)
{
BuffBuilderChangeMessage * outMsg = new BuffBuilderChangeMessage();
@@ -1333,7 +1333,7 @@ void PlayerCreatureController::handleMessage (const int message, const float val
{
//check and apply this data once the recipient also accepts
Object * const recipientObject = NetworkIdManager::getObjectById(inMsg->getRecipientId());
Controller * const recipientController = recipientObject ? recipientObject->getController() : NULL;
Controller * const recipientController = recipientObject ? recipientObject->getController() : nullptr;
if(recipientController)
{
BuffBuilderChangeMessage * outMsg = new BuffBuilderChangeMessage();
@@ -1351,7 +1351,7 @@ void PlayerCreatureController::handleMessage (const int message, const float val
//recipient hasn't accepted yet, send the data to the buffer to update the recipient-sent amount of money
//buffer hasn't accepted yet, send change to the client so they can see it before agreeing
Object * const bufferObject = NetworkIdManager::getObjectById(inMsg->getBufferId());
Controller * const bufferController = bufferObject ? bufferObject->getController() : NULL;
Controller * const bufferController = bufferObject ? bufferObject->getController() : nullptr;
if(bufferController)
{
BuffBuilderChangeMessage * outMsg = new BuffBuilderChangeMessage();
@@ -1425,7 +1425,7 @@ void PlayerCreatureController::handleMessage (const int message, const float val
{
//if the recipient canceled the session, tell the designer
Object const * const bufferObject = NetworkIdManager::getObjectById(session.bufferId);
ServerObject const * const buffer = bufferObject ? bufferObject->asServerObject() : NULL;
ServerObject const * const buffer = bufferObject ? bufferObject->asServerObject() : nullptr;
if(buffer && (owner->getNetworkId() != session.bufferId))
{
@@ -1447,7 +1447,7 @@ void PlayerCreatureController::handleMessage (const int message, const float val
if(msg)
{
Object const * const terminalO = NetworkIdManager::getObjectById(msg->getValue());
ServerObject const * const terminal = terminalO ? terminalO->asServerObject() : NULL;
ServerObject const * const terminal = terminalO ? terminalO->asServerObject() : nullptr;
if(terminal)
{
Client const * const client = owner->getClient();
@@ -1461,7 +1461,7 @@ void PlayerCreatureController::handleMessage (const int message, const float val
if(!client->isGod())
{
Object const * const buildingO = ContainerInterface::getTopmostContainer(*terminal);
ServerObject const * const building = buildingO ? buildingO->asServerObject() : NULL;
ServerObject const * const building = buildingO ? buildingO->asServerObject() : nullptr;
if(building)
{
DynamicVariableList const & buildingObjVars = building->getObjVars();
@@ -1478,13 +1478,13 @@ void PlayerCreatureController::handleMessage (const int message, const float val
for(std::vector<NetworkId>::const_iterator i = ships.begin(); i != ships.end(); ++i)
{
Object const * const shipO = NetworkIdManager::getObjectById(*i);
ServerObject const * const shipSO = shipO ? shipO->asServerObject() : NULL;
ShipObject const * const ship = shipSO ? shipSO->asShipObject() : NULL;
ServerObject const * const shipSO = shipO ? shipO->asServerObject() : nullptr;
ShipObject const * const ship = shipSO ? shipSO->asShipObject() : nullptr;
if(ship)
{
ContainedByProperty const * const contained = ship->getContainedByProperty();
Object const * const containerO = contained ? contained->getContainedBy() : NULL;
ServerObject const * const container = containerO ? containerO->asServerObject() : NULL;
Object const * const containerO = contained ? contained->getContainedBy() : nullptr;
ServerObject const * const container = containerO ? containerO->asServerObject() : nullptr;
if(container)
{
DynamicVariableList const & shipControlDeviceObjVars = container->getObjVars();
@@ -1665,14 +1665,14 @@ void PlayerCreatureController::handleMessage (const int message, const float val
{
MessageQueueCyberneticsChangeRequest const * const msg = dynamic_cast<MessageQueueCyberneticsChangeRequest const *>(data);
NOT_NULL(msg);
if (msg != NULL)
if (msg != nullptr)
{
CreatureObject * const owner = NON_NULL(getCreature());
if(owner)
{
NetworkId const & npcId = msg->getTarget();
Object * const o = NetworkIdManager::getObjectById(npcId);
ServerObject * const so = o ? o->asServerObject() : NULL;
ServerObject * const so = o ? o->asServerObject() : nullptr;
if(so)
{
Controller * const npcController = so->getController();
@@ -1696,10 +1696,10 @@ void PlayerCreatureController::handleMessage (const int message, const float val
case CM_spaceMiningSaleSellResource:
{
MessageQueueSpaceMiningSellResource const * const msg = dynamic_cast<MessageQueueSpaceMiningSellResource const *>(data);
if (msg != NULL)
if (msg != nullptr)
{
ServerObject * const spaceStation = safe_cast<ServerObject *>(NetworkIdManager::getObjectById(msg->m_spaceStationId));
if (NULL == spaceStation)
if (nullptr == spaceStation)
{
WARNING(true, ("PlayerCreatureController CM_spaceMiningSaleSellResource invalid station [%s]", msg->m_spaceStationId.getValueString().c_str()));
}
@@ -1784,7 +1784,7 @@ void PlayerCreatureController::handleMessage (const int message, const float val
DictionaryValueMap::const_iterator itr = valueMap.find(minigameResultTargetName);
if(itr != valueMap.end() && itr->second != NULL)
if(itr != valueMap.end() && itr->second != nullptr)
{
if(itr->second->getType() == ValueTypeObjId::ms_type)
{
@@ -1798,7 +1798,7 @@ void PlayerCreatureController::handleMessage (const int message, const float val
ScriptDictionaryPtr dictionary;
GameScriptObject::makeScriptDictionary(params, dictionary);
if (dictionary.get() != NULL)
if (dictionary.get() != nullptr)
{
dictionary->serialize();
MessageToQueue::getInstance().sendMessageToJava(tableOid,
@@ -1859,7 +1859,7 @@ void PlayerCreatureController::handleMessage (const int message, const float val
params.addParam(paramsDict, "taskDictionary");
ScriptDictionaryPtr dictionary;
GameScriptObject::makeScriptDictionary(params, dictionary);
if (dictionary.get() != NULL)
if (dictionary.get() != nullptr)
{
dictionary->serialize();
MessageToQueue::getInstance().sendMessageToJava(owner->getNetworkId(),
@@ -295,10 +295,10 @@ void PlayerShipController::handleMessage(int const message, float const value, M
case CM_spaceMiningSaleSellResource:
{
MessageQueueSpaceMiningSellResource const * const msg = dynamic_cast<MessageQueueSpaceMiningSellResource const *>(data);
if (msg != NULL)
if (msg != nullptr)
{
ServerObject * const spaceStation = safe_cast<ServerObject *>(NetworkIdManager::getObjectById(msg->m_spaceStationId));
if (NULL == spaceStation)
if (nullptr == spaceStation)
{
WARNING(true, ("PlayerCreatureController CM_spaceMiningSaleSellResource invalid station [%s]", msg->m_spaceStationId.getValueString().c_str()));
}
@@ -376,16 +376,16 @@ float PlayerShipController::realAlter(float const elapsedTime)
if (owner && owner->isInitialized())
{
if (m_pendingDockingBehavior != NULL)
if (m_pendingDockingBehavior != nullptr)
{
delete m_dockingBehavior;
m_dockingBehavior = m_pendingDockingBehavior;
m_pendingDockingBehavior = NULL;
m_pendingDockingBehavior = nullptr;
getShipOwner()->setCondition(static_cast<int>(TangibleObject::C_docking));
Client * const client = owner->getClient();
if (client != NULL)
if (client != nullptr)
{
ShipClientUpdateTracker::queueForUpdate(*client, *owner);
}
@@ -395,16 +395,16 @@ float PlayerShipController::realAlter(float const elapsedTime)
}
}
if ( (m_dockingBehavior != NULL)
if ( (m_dockingBehavior != nullptr)
&& m_dockingBehavior->isDockFinished())
{
delete m_dockingBehavior;
m_dockingBehavior = NULL;
m_dockingBehavior = nullptr;
getShipOwner()->clearCondition(static_cast<int>(TangibleObject::C_docking));
}
if (m_dockingBehavior != NULL)
if (m_dockingBehavior != nullptr)
{
//-- The docking behavior will calculate new values for m_yaw/m_pitch/m_roll/m_throttle[Position] implicitly through calling ShipController members
m_dockingBehavior->alter(elapsedTime);
@@ -806,7 +806,7 @@ void PlayerShipController::setWeaponIndexPlayerControlled(int const weaponIndex,
{
DEBUG_FATAL((weaponIndex < 0), ("Invalid weaponIndex(%d)", weaponIndex));
if (m_turretTargetingSystem != NULL)
if (m_turretTargetingSystem != nullptr)
{
safe_cast<PlayerShipTurretTargetingSystem*>(m_turretTargetingSystem)->setWeaponIndexPlayerControlled(weaponIndex, playerControlled);
}
@@ -55,7 +55,7 @@
CellProperty const * getCell(Object const * obj)
{
if(obj == NULL) return NULL;
if(obj == nullptr) return nullptr;
return obj->getCellProperty();
}
@@ -74,7 +74,7 @@ Vector movePointBetweenCells ( Object const * oldCellObject, Object const * new
Transform toWorld = Transform::identity;
Transform toCell = Transform::identity;
if(oldCellObject != NULL)
if(oldCellObject != nullptr)
{
CellProperty const * oldCell = getCell(oldCellObject);
@@ -84,7 +84,7 @@ Vector movePointBetweenCells ( Object const * oldCellObject, Object const * new
}
}
if(newCellObject != NULL)
if(newCellObject != nullptr)
{
CellProperty const * newCell = getCell(newCellObject);
@@ -115,7 +115,7 @@ Transform moveTransformBetweenCells ( Object const * oldCellObject, Object const
Transform toWorld = Transform::identity;
Transform toCell = Transform::identity;
if(oldCellObject != NULL)
if(oldCellObject != nullptr)
{
CellProperty const * oldCell = getCell(oldCellObject);
@@ -125,7 +125,7 @@ Transform moveTransformBetweenCells ( Object const * oldCellObject, Object const
}
}
if(newCellObject != NULL)
if(newCellObject != nullptr)
{
CellProperty const * newCell = getCell(newCellObject);
@@ -220,7 +220,7 @@ void ServerController::setAuthoritative(bool newAuthoritative)
{
if (!newAuthoritative && m_bHasGoal && m_goalCellObject)
{
m_goalCellObject = NULL;
m_goalCellObject = nullptr;
m_bHasGoal = false;
m_bAtGoal = true;
}
@@ -420,7 +420,7 @@ bool changeCells(ServerObject &object, ServerObject *newCellObject)
// ----------
if (newCellObject == NULL)
if (newCellObject == nullptr)
{
// Object was in a cell and is moving to the world, transfer from cell container to world
@@ -428,7 +428,7 @@ bool changeCells(ServerObject &object, ServerObject *newCellObject)
Transform const &newTransform = oldCellObject->getTransform_o2w().rotateTranslate_l2p(objectTransform);
Container::ContainerErrorCode tmp = Container::CEC_Success;
result = ContainerInterface::transferItemToWorld(object, newTransform, NULL, tmp);
result = ContainerInterface::transferItemToWorld(object, newTransform, nullptr, tmp);
if (!result)
{
@@ -444,13 +444,13 @@ bool changeCells(ServerObject &object, ServerObject *newCellObject)
CellProperty * const pCell = ContainerInterface::getCell(*newCellObject);
DEBUG_REPORT_LOG(pCell == NULL, ("changeCells - Received transform with parent to a non-cell object. This should only happen from the DB\n"));
DEBUG_REPORT_LOG(pCell == nullptr, ("changeCells - Received transform with parent to a non-cell object. This should only happen from the DB\n"));
if (pCell)
{
Transform objectTransform = object.getTransform_o2p();
Container::ContainerErrorCode tmp = Container::CEC_Success;
result = ContainerInterface::transferItemToCell(*newCellObject, object, NULL, tmp);
result = ContainerInterface::transferItemToCell(*newCellObject, object, nullptr, tmp);
if (!result)
{
@@ -537,7 +537,7 @@ void ServerController::handleNetUpdateTransform(const MessageQueueDataTransform&
return;
}
setGoal( message.getTransform(), NULL );
setGoal( message.getTransform(), nullptr );
}
//-----------------------------------------------------------------------
@@ -566,7 +566,7 @@ void ServerController::handleNetUpdateTransformWithParent(const MessageQueueData
#if 1
Transform start = Transform::identity;
start.setPosition_p(ConfigServerGame::getStartingPosition());
setGoal( start, NULL );
setGoal( start, nullptr );
#endif
return;
}
@@ -58,12 +58,12 @@ ShipController::ShipController(ShipObject * newOwner) :
m_pitchPosition(0.0f),
m_rollPosition(0.0f),
m_throttlePosition(0.0f),
m_pendingDockingBehavior(NULL),
m_dockingBehavior(NULL),
m_pendingDockingBehavior(nullptr),
m_dockingBehavior(nullptr),
m_attackTargetList(new AiShipAttackTargetList(newOwner)),
m_attackTargetDecayTimer(new Timer(static_cast<float>(s_maxTargetAge))),
m_enemyCheckQueued(false),
m_turretTargetingSystem(NULL),
m_turretTargetingSystem(nullptr),
m_dockedByList(new DockedByList),
m_aiTargetingMeList(new CachedNetworkIdList)
{
@@ -77,7 +77,7 @@ ShipController::~ShipController()
// The turret targeting system must be deleted before clearAiTargetingMeList(), because
// otherwise it will try to acquire new targets as the list is being cleared
delete m_turretTargetingSystem;
m_turretTargetingSystem = NULL;
m_turretTargetingSystem = nullptr;
clearAiTargetingMeList();
@@ -85,9 +85,9 @@ ShipController::~ShipController()
delete m_dockedByList;
delete m_aiTargetingMeList;
delete m_pendingDockingBehavior;
m_pendingDockingBehavior = NULL;
m_pendingDockingBehavior = nullptr;
delete m_dockingBehavior;
m_dockingBehavior = NULL;
m_dockingBehavior = nullptr;
delete m_attackTargetList;
delete m_attackTargetDecayTimer;
}
@@ -226,7 +226,7 @@ void ShipController::handleMessage (const int message, const float value, const
UNREF(flags);
UNREF(value);
ShipObject * const owner = getShipOwner();
DEBUG_FATAL(!owner, ("Owner is NULL in ShipController::handleMessage\n"));
DEBUG_FATAL(!owner, ("Owner is nullptr in ShipController::handleMessage\n"));
switch(message)
{
case CM_clientLookAtTarget:
@@ -265,7 +265,7 @@ void ShipController::addTurretTargetingSystem(ShipTurretTargetingSystem * newSys
void ShipController::removeTurretTargetingSystem()
{
delete m_turretTargetingSystem;
m_turretTargetingSystem = NULL;
m_turretTargetingSystem = nullptr;
}
// ----------------------------------------------------------------------
@@ -281,7 +281,7 @@ void ShipController::addDockedBy(Object const & unit)
{
IGNORE_RETURN(m_dockedByList->insert(CachedNetworkId(unit)));
LOGC(ConfigServerGame::isSpaceAiLoggingEnabled(), "space_debug_ai", ("ShipController::addDockedBy() owner(%s) dockedBy(%s) dockedByListSize(%u)", (getOwner() != NULL) ? getOwner()->getNetworkId().getValueString().c_str() : "NULL", unit.getNetworkId().getValueString().c_str(), m_dockedByList->size()));
LOGC(ConfigServerGame::isSpaceAiLoggingEnabled(), "space_debug_ai", ("ShipController::addDockedBy() owner(%s) dockedBy(%s) dockedByListSize(%u)", (getOwner() != nullptr) ? getOwner()->getNetworkId().getValueString().c_str() : "nullptr", unit.getNetworkId().getValueString().c_str(), m_dockedByList->size()));
}
// ----------------------------------------------------------------------
@@ -294,7 +294,7 @@ void ShipController::removeDockedBy(Object const & unit)
{
m_dockedByList->erase(iterDockedByList);
LOGC(ConfigServerGame::isSpaceAiLoggingEnabled(), "space_debug_ai", ("ShipController::removeDockedBy() owner(%s) dockedBy(%s) dockedByListSize(%u)", (getOwner() != NULL) ? getOwner()->getNetworkId().getValueString().c_str() : "NULL", unit.getNetworkId().getValueString().c_str(), m_dockedByList->size()));
LOGC(ConfigServerGame::isSpaceAiLoggingEnabled(), "space_debug_ai", ("ShipController::removeDockedBy() owner(%s) dockedBy(%s) dockedByListSize(%u)", (getOwner() != nullptr) ? getOwner()->getNetworkId().getValueString().c_str() : "nullptr", unit.getNetworkId().getValueString().c_str(), m_dockedByList->size()));
}
else
{
@@ -314,7 +314,7 @@ ShipController::DockedByList const & ShipController::getDockedByList() const
void ShipController::addAiTargetingMe(NetworkId const & unit)
{
//LOGC(ConfigServerGame::isSpaceAiLoggingEnabled(), "space_debug_ai", ("ShipController::addAiTargetingMe() owner(%s) unit(%s) m_aiTargetingMeList->size(%u+1)", getOwner()->getNetworkId().getValueString().c_str(), unit.getValueString().c_str(), m_aiTargetingMeList->size()));
DEBUG_FATAL((NetworkIdManager::getObjectById(unit) == NULL), ("ShipController::addAiTargetingMe() owner(%s) unit(%s) ERROR: The Ai who is targeting you is not a valid networkId", getOwner()->getNetworkId().getValueString().c_str(), unit.getValueString().c_str()));
DEBUG_FATAL((NetworkIdManager::getObjectById(unit) == nullptr), ("ShipController::addAiTargetingMe() owner(%s) unit(%s) ERROR: The Ai who is targeting you is not a valid networkId", getOwner()->getNetworkId().getValueString().c_str(), unit.getValueString().c_str()));
// Make sure this is a valid networkId of an alive object
@@ -346,11 +346,11 @@ void ShipController::removeAiTargetingMe(NetworkId const & unit)
{
ShipObject * const shipOwner = getShipOwner();
if (shipOwner != NULL)
if (shipOwner != nullptr)
{
CreatureObject * const pilotOwner = CreatureObject::asCreatureObject(shipOwner->getPilot());
if ( (pilotOwner != NULL)
if ( (pilotOwner != nullptr)
&& pilotOwner->isPlayerControlled())
{
shipOwner->clearCondition(static_cast<int>(TangibleObject::C_spaceCombatMusic));
@@ -442,7 +442,7 @@ bool ShipController::face(Vector const & goalPosition_w, float elapsedTime)
bool useFastAxis = true;
AiShipController const * const aiShipController = asAiShipController();
if (aiShipController != NULL)
if (aiShipController != nullptr)
{
if ( (aiShipController->getShipClass() == ShipAiReactionManager::SC_capitalShip)
|| (aiShipController->getShipClass() == ShipAiReactionManager::SC_transport)
@@ -620,7 +620,7 @@ float ShipController::getLargestTurnRadius() const
ShipObject const * const shipObject = getShipOwner();
if (shipObject != NULL)
if (shipObject != nullptr)
{
float const maxYawRate = shipObject->getShipActualYawRateMaximum();
float const maxPitchRate = shipObject->getShipActualPitchRateMaximum();
@@ -650,11 +650,11 @@ void ShipController::dock(ShipObject & dockTarget, float const secondsAtDock)
void ShipController::unDock()
{
if (m_pendingDockingBehavior != NULL)
if (m_pendingDockingBehavior != nullptr)
{
m_pendingDockingBehavior->unDock();
}
else if (m_dockingBehavior != NULL)
else if (m_dockingBehavior != nullptr)
{
m_dockingBehavior->unDock();
}
@@ -664,14 +664,14 @@ void ShipController::unDock()
bool ShipController::isDocking() const
{
return (m_dockingBehavior != NULL) || (m_pendingDockingBehavior != NULL);
return (m_dockingBehavior != nullptr) || (m_pendingDockingBehavior != nullptr);
}
// ----------------------------------------------------------------------
bool ShipController::isDocked() const
{
return ((m_dockingBehavior != NULL) && m_dockingBehavior->isDocked());
return ((m_dockingBehavior != nullptr) && m_dockingBehavior->isDocked());
}
// ----------------------------------------------------------------------
@@ -698,28 +698,28 @@ ShipController const * ShipController::asShipController() const
PlayerShipController * ShipController::asPlayerShipController()
{
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------
PlayerShipController const * ShipController::asPlayerShipController() const
{
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------
AiShipController * ShipController::asAiShipController()
{
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------
AiShipController const * ShipController::asAiShipController() const
{
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------
@@ -736,7 +736,7 @@ bool ShipController::addDamageTaken(NetworkId const & attackingUnit, float const
bool result = false;
ShipObject * const attackingUnitShipObject = ShipObject::asShipObject(NetworkIdManager::getObjectById(attackingUnit));
if ( (attackingUnitShipObject != NULL)
if ( (attackingUnitShipObject != nullptr)
&& !attackingUnitShipObject->isDamageAggroImmune())
{
result = verifyAttacker ? Pvp::canAttack(*attackingUnitShipObject, *NON_NULL(getShipOwner())) : true;
@@ -754,7 +754,7 @@ bool ShipController::addDamageTaken(NetworkId const & attackingUnit, float const
bool ShipController::hasTurretTargetingSystem() const
{
return (m_turretTargetingSystem != NULL);
return (m_turretTargetingSystem != nullptr);
}
// ----------------------------------------------------------------------
@@ -792,7 +792,7 @@ bool ShipController::removeAttackTarget(NetworkId const & unit)
void ShipController::onAttackTargetChanged(NetworkId const & target)
{
if (m_turretTargetingSystem != NULL)
if (m_turretTargetingSystem != nullptr)
{
m_turretTargetingSystem->onTargetChanged(target);
}
@@ -802,7 +802,7 @@ void ShipController::onAttackTargetChanged(NetworkId const & target)
void ShipController::onAttackTargetLost(NetworkId const & target)
{
if (m_turretTargetingSystem != NULL)
if (m_turretTargetingSystem != nullptr)
{
m_turretTargetingSystem->onTargetLost(target);
}
@@ -834,12 +834,12 @@ int ShipController::getNumberOfAiUnitsAttackingMe() const
CachedNetworkId const & ai = (*iterAiTargetingMeList);
Object const * const aiObject = ai.getObject();
if (aiObject != NULL)
if (aiObject != nullptr)
{
ShipController const * const shipController = aiObject->getController()->asShipController();
AiShipController const * const aiShipController = (shipController != NULL) ? shipController->asAiShipController() : NULL;
AiShipController const * const aiShipController = (shipController != nullptr) ? shipController->asAiShipController() : nullptr;
if (aiShipController != NULL)
if (aiShipController != nullptr)
{
if (aiShipController->getPrimaryAttackTarget() == getOwner()->getNetworkId())
{
@@ -849,7 +849,7 @@ int ShipController::getNumberOfAiUnitsAttackingMe() const
}
else
{
DEBUG_WARNING(true, ("ShipController::getNumberOfAiShipAttackingMe() ERROR: Why am I(%s) being targeted by a NULL object(%s)?", getOwner()->getDebugInformation().c_str(), ai.getValueString().c_str()));
DEBUG_WARNING(true, ("ShipController::getNumberOfAiShipAttackingMe() ERROR: Why am I(%s) being targeted by a nullptr object(%s)?", getOwner()->getDebugInformation().c_str(), ai.getValueString().c_str()));
}
}
@@ -910,11 +910,11 @@ void ShipController::clearAiTargetingMeList()
{
CachedNetworkId const & id = (*iterPurgeList);
if (id.getObject() != NULL)
if (id.getObject() != nullptr)
{
ShipController * const shipController = id.getObject()->getController()->asShipController();
if (shipController != NULL)
if (shipController != nullptr)
{
IGNORE_RETURN(shipController->removeAttackTarget(getOwner()->getNetworkId()));
}
@@ -222,7 +222,7 @@ void TangibleController::handleMessage (const int message, const float value, co
case CM_addHate:
{
const MessageQueueGenericValueType<std::pair<NetworkId, float> > * const msg = safe_cast<const MessageQueueGenericValueType<std::pair<NetworkId, float> > *>(data);
WARNING((msg == NULL), ("TangibleController::handleMessage(CM_addHate) The message data should never be NULL"));
WARNING((msg == nullptr), ("TangibleController::handleMessage(CM_addHate) The message data should never be nullptr"));
if(msg)
{
@@ -233,7 +233,7 @@ void TangibleController::handleMessage (const int message, const float value, co
case CM_setHate:
{
const MessageQueueGenericValueType<std::pair<NetworkId, float> > * const msg = safe_cast<const MessageQueueGenericValueType<std::pair<NetworkId, float> > *>(data);
WARNING((msg == NULL), ("TangibleController::handleMessage(CM_setHate) The message data should never be NULL"));
WARNING((msg == nullptr), ("TangibleController::handleMessage(CM_setHate) The message data should never be nullptr"));
if(msg)
{
@@ -244,7 +244,7 @@ void TangibleController::handleMessage (const int message, const float value, co
case CM_removeHateTarget:
{
const MessageQueueGenericValueType<NetworkId> * const msg = safe_cast<const MessageQueueGenericValueType<NetworkId> *>(data);
WARNING((msg == NULL), ("TangibleController::handleMessage(CM_removeHateTarget) The message data should never be NULL"));
WARNING((msg == nullptr), ("TangibleController::handleMessage(CM_removeHateTarget) The message data should never be nullptr"));
if(msg)
{
@@ -265,7 +265,7 @@ void TangibleController::handleMessage (const int message, const float value, co
case CM_forceHateTarget:
{
const MessageQueueGenericValueType<NetworkId> * const msg = safe_cast<const MessageQueueGenericValueType<NetworkId> *>(data);
WARNING((msg == NULL), ("TangibleController::handleMessage(CM_removeHateTarget) The message data should never be NULL"));
WARNING((msg == nullptr), ("TangibleController::handleMessage(CM_removeHateTarget) The message data should never be nullptr"));
if(msg)
{
@@ -276,9 +276,9 @@ void TangibleController::handleMessage (const int message, const float value, co
case CM_autoExpireHateListTargetEnabled:
{
const MessageQueueGenericValueType<bool> * const msg = safe_cast<const MessageQueueGenericValueType<bool> *>(data);
WARNING((msg == NULL), ("TangibleController::handleMessage(CM_setHateListExpireTargetEnabled) The message data should never be NULL"));
WARNING((msg == nullptr), ("TangibleController::handleMessage(CM_setHateListExpireTargetEnabled) The message data should never be nullptr"));
if (msg != NULL)
if (msg != nullptr)
{
owner->setHateListAutoExpireTargetEnabled(msg->getValue());
}
@@ -315,7 +315,7 @@ void TangibleController::handleMessage (const int message, const float value, co
if(object)
{
ServerObject * transferer = safe_cast<ServerObject *>(NetworkIdManager::getObjectById(msg->getValue().second));
// transferer is allowed to be null
// transferer is allowed to be nullptr
owner->addObjectToOutputSlot(*object, transferer);
}
}
@@ -576,7 +576,7 @@ void TangibleController::handleMessage (const int message, const float value, co
case CM_addUserToAccessList:
{
MessageQueueGenericValueType<std::pair<int, NetworkId> > const *msg = safe_cast<MessageQueueGenericValueType<std::pair<int, NetworkId> > const *>(data);
WARNING((msg == NULL), ("TangibleController::handleMessage(CM_addUserToAccessList) The message data should never be NULL"));
WARNING((msg == nullptr), ("TangibleController::handleMessage(CM_addUserToAccessList) The message data should never be nullptr"));
if(msg)
{
@@ -590,7 +590,7 @@ void TangibleController::handleMessage (const int message, const float value, co
case CM_removeUserFromAccessList:
{
MessageQueueGenericValueType<std::pair<int, NetworkId> > const *msg = safe_cast<MessageQueueGenericValueType<std::pair<int, NetworkId> > const *>(data);
WARNING((msg == NULL), ("TangibleController::handleMessage(CM_removeUserFromAccessList) The message data should never be NULL"));
WARNING((msg == nullptr), ("TangibleController::handleMessage(CM_removeUserFromAccessList) The message data should never be nullptr"));
if(msg)
{
@@ -722,14 +722,14 @@ TangibleController const * TangibleController::asTangibleController() const
AiTurretController * TangibleController::asAiTurretController()
{
return NULL;
return nullptr;
}
//----------------------------------------------------------------------
AiTurretController const * TangibleController::asAiTurretController() const
{
return NULL;
return nullptr;
}
//========================================================================