diff --git a/src/command.cpp b/src/command.cpp --- a/src/command.cpp +++ b/src/command.cpp @@ -361,7 +361,7 @@ static const Command _command_proc_table }; /*! - * This function range-checks a cmd, and checks if the cmd is not NULL + * This function range-checks a cmd, and checks if the cmd is not nullptr * * @param cmd The integer value of a command * @return true if the command is valid (and got a CommandProc function) @@ -370,7 +370,7 @@ bool IsValidCommand(uint32 cmd) { cmd &= CMD_ID_MASK; - return cmd < lengthof(_command_proc_table) && _command_proc_table[cmd].proc != NULL; + return cmd < lengthof(_command_proc_table) && _command_proc_table[cmd].proc != nullptr; } /*! @@ -594,7 +594,7 @@ bool DoCommandP(TileIndex tile, uint32 p ShowCostOrIncomeAnimation(x, y, GetSlopePixelZ(x, y), res.GetCost()); } - if (!estimate_only && !only_sending && callback != NULL) { + if (!estimate_only && !only_sending && callback != nullptr) { callback(res, tile, p1, p2); } @@ -637,7 +637,7 @@ CommandCost DoCommandPInternal(TileIndex CommandProc *proc = _command_proc_table[cmd_id].proc; /* Shouldn't happen, but you never know when someone adds * NULLs to the _command_proc_table. */ - assert(proc != NULL); + assert(proc != nullptr); /* Command flags are used internally */ CommandFlags cmd_flags = GetCommandFlags(cmd); @@ -750,7 +750,7 @@ CommandCost DoCommandPInternal(TileIndex /* update last build coordinate of company. */ if (tile != 0) { Company *c = Company::GetIfValid(_current_company); - if (c != NULL) c->last_build_coordinate = tile; + if (c != nullptr) c->last_build_coordinate = tile; } SubtractMoneyFromCompany(res2);