mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-21 14:02:59 +01:00
Improve variable initialisation, if statements and assertions
This commit is contained in:
@@ -608,7 +608,7 @@ int32_t cmdline_for_sprite(const char** argv, int32_t argc)
|
||||
}
|
||||
|
||||
json_t* path = json_object_get(sprite_description, "path");
|
||||
if (!path || !json_is_string(path))
|
||||
if (!json_is_string(path))
|
||||
{
|
||||
fprintf(stderr, "Error: no path provided for sprite %lu\n", (unsigned long)i);
|
||||
json_decref(sprite_list);
|
||||
|
||||
@@ -55,9 +55,9 @@ private:
|
||||
int32_t _wallType{ -1 };
|
||||
CoordsXYZ _loc;
|
||||
Direction _edge{ INVALID_DIRECTION };
|
||||
int32_t _primaryColour{ 0 };
|
||||
int32_t _secondaryColour{ 0 };
|
||||
int32_t _tertiaryColour{ 0 };
|
||||
int32_t _primaryColour{ COLOUR_BLACK };
|
||||
int32_t _secondaryColour{ COLOUR_BLACK };
|
||||
int32_t _tertiaryColour{ COLOUR_BLACK };
|
||||
BannerIndex _bannerId{ BANNER_INDEX_NULL };
|
||||
|
||||
public:
|
||||
|
||||
@@ -1356,7 +1356,7 @@ void Network::BeginServerLog()
|
||||
else
|
||||
{
|
||||
logMessage[0] = '\0';
|
||||
assert(0 && "Uninitialized mode");
|
||||
Guard::Assert(false, "Unknown network mode!");
|
||||
}
|
||||
AppendServerLog(logMessage);
|
||||
}
|
||||
@@ -1384,7 +1384,7 @@ void Network::CloseServerLog()
|
||||
else
|
||||
{
|
||||
logMessage[0] = '\0';
|
||||
assert(0 && "Uninitialized mode");
|
||||
Guard::Assert(false, "Unknown network mode!");
|
||||
}
|
||||
AppendServerLog(logMessage);
|
||||
_server_log_fs.close();
|
||||
|
||||
Reference in New Issue
Block a user