Project modernization (#630)
* Fixed boats falling and a TP glitch #266 * Replaced every C-style cast with C++ ones * Replaced every C-style cast with C++ ones * Fixed boats falling and a TP glitch #266 * Updated NULL to nullptr and fixing some type issues * Modernized and fixed a few bugs - Replaced most instances of `NULL` with `nullptr`. - Replaced most `shared_ptr(new ...)` with `make_shared`. - Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances. * Fixing more conflicts * Replace int loops with size_t and start work on overrides
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
ConsoleGenerateStructure::ConsoleGenerateStructure() : StructurePiece(0)
|
||||
{
|
||||
m_x = m_y = m_z = 0;
|
||||
boundingBox = NULL;
|
||||
boundingBox = nullptr;
|
||||
orientation = Direction::NORTH;
|
||||
m_dimension = 0;
|
||||
}
|
||||
@@ -25,26 +25,26 @@ void ConsoleGenerateStructure::getChildren(vector<GameRuleDefinition *> *childre
|
||||
|
||||
GameRuleDefinition *ConsoleGenerateStructure::addChild(ConsoleGameRules::EGameRuleType ruleType)
|
||||
{
|
||||
GameRuleDefinition *rule = NULL;
|
||||
GameRuleDefinition *rule = nullptr;
|
||||
if(ruleType == ConsoleGameRules::eGameRuleType_GenerateBox)
|
||||
{
|
||||
rule = new XboxStructureActionGenerateBox();
|
||||
m_actions.push_back((XboxStructureActionGenerateBox *)rule);
|
||||
m_actions.push_back(static_cast<XboxStructureActionGenerateBox *>(rule));
|
||||
}
|
||||
else if(ruleType == ConsoleGameRules::eGameRuleType_PlaceBlock)
|
||||
{
|
||||
rule = new XboxStructureActionPlaceBlock();
|
||||
m_actions.push_back((XboxStructureActionPlaceBlock *)rule);
|
||||
m_actions.push_back(static_cast<XboxStructureActionPlaceBlock *>(rule));
|
||||
}
|
||||
else if(ruleType == ConsoleGameRules::eGameRuleType_PlaceContainer)
|
||||
{
|
||||
rule = new XboxStructureActionPlaceContainer();
|
||||
m_actions.push_back((XboxStructureActionPlaceContainer *)rule);
|
||||
m_actions.push_back(static_cast<XboxStructureActionPlaceContainer *>(rule));
|
||||
}
|
||||
else if(ruleType == ConsoleGameRules::eGameRuleType_PlaceSpawner)
|
||||
{
|
||||
rule = new XboxStructureActionPlaceSpawner();
|
||||
m_actions.push_back((XboxStructureActionPlaceSpawner *)rule);
|
||||
m_actions.push_back(static_cast<XboxStructureActionPlaceSpawner *>(rule));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -112,7 +112,7 @@ void ConsoleGenerateStructure::addAttribute(const wstring &attributeName, const
|
||||
|
||||
BoundingBox* ConsoleGenerateStructure::getBoundingBox()
|
||||
{
|
||||
if(boundingBox == NULL)
|
||||
if(boundingBox == nullptr)
|
||||
{
|
||||
// Find the max bounds
|
||||
int maxX, maxY, maxZ;
|
||||
@@ -139,25 +139,25 @@ bool ConsoleGenerateStructure::postProcess(Level *level, Random *random, Boundin
|
||||
{
|
||||
case ConsoleGameRules::eGameRuleType_GenerateBox:
|
||||
{
|
||||
XboxStructureActionGenerateBox *genBox = (XboxStructureActionGenerateBox *)action;
|
||||
XboxStructureActionGenerateBox *genBox = static_cast<XboxStructureActionGenerateBox *>(action);
|
||||
genBox->generateBoxInLevel(this,level,chunkBB);
|
||||
}
|
||||
break;
|
||||
case ConsoleGameRules::eGameRuleType_PlaceBlock:
|
||||
{
|
||||
XboxStructureActionPlaceBlock *pPlaceBlock = (XboxStructureActionPlaceBlock *)action;
|
||||
XboxStructureActionPlaceBlock *pPlaceBlock = static_cast<XboxStructureActionPlaceBlock *>(action);
|
||||
pPlaceBlock->placeBlockInLevel(this,level,chunkBB);
|
||||
}
|
||||
break;
|
||||
case ConsoleGameRules::eGameRuleType_PlaceContainer:
|
||||
{
|
||||
XboxStructureActionPlaceContainer *pPlaceContainer = (XboxStructureActionPlaceContainer *)action;
|
||||
XboxStructureActionPlaceContainer *pPlaceContainer = static_cast<XboxStructureActionPlaceContainer *>(action);
|
||||
pPlaceContainer->placeContainerInLevel(this,level,chunkBB);
|
||||
}
|
||||
break;
|
||||
case ConsoleGameRules::eGameRuleType_PlaceSpawner:
|
||||
{
|
||||
XboxStructureActionPlaceSpawner *pPlaceSpawner = (XboxStructureActionPlaceSpawner *)action;
|
||||
XboxStructureActionPlaceSpawner *pPlaceSpawner = static_cast<XboxStructureActionPlaceSpawner *>(action);
|
||||
pPlaceSpawner->placeSpawnerInLevel(this,level,chunkBB);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user