Merge pull request #380 from diamante0018/goofy-warnings

Fix some justified warnings & more
This commit is contained in:
Dss0 2022-07-21 19:50:49 +02:00 committed by GitHub
commit b52142bbb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 11 deletions

View File

@ -355,7 +355,7 @@ namespace Components
{ {
const auto* ent = Game::GetPlayerEntity(entref); const auto* ent = Game::GetPlayerEntity(entref);
if (Game::Scr_GetNumParam() >= 1u) if (Game::Scr_GetNumParam() >= 1)
{ {
if (Game::Scr_GetInt(0)) if (Game::Scr_GetInt(0))
{ {
@ -376,7 +376,7 @@ namespace Components
{ {
const auto* ent = Game::GetPlayerEntity(entref); const auto* ent = Game::GetPlayerEntity(entref);
if (Game::Scr_GetNumParam() >= 1u) if (Game::Scr_GetNumParam() >= 1)
{ {
if (Game::Scr_GetInt(0)) if (Game::Scr_GetInt(0))
{ {
@ -397,7 +397,7 @@ namespace Components
{ {
auto* ent = Game::GetEntity(entref); auto* ent = Game::GetEntity(entref);
if (Game::Scr_GetNumParam() >= 1u) if (Game::Scr_GetNumParam() >= 1)
{ {
if (Game::Scr_GetInt(0)) if (Game::Scr_GetInt(0))
{ {
@ -418,7 +418,7 @@ namespace Components
{ {
auto* ent = Game::GetEntity(entref); auto* ent = Game::GetEntity(entref);
if (Game::Scr_GetNumParam() >= 1u) if (Game::Scr_GetNumParam() >= 1)
{ {
if (Game::Scr_GetInt(0)) if (Game::Scr_GetInt(0))
{ {
@ -439,7 +439,7 @@ namespace Components
{ {
auto* ent = Game::GetEntity(entref); auto* ent = Game::GetEntity(entref);
if (Game::Scr_GetNumParam() >= 1u) if (Game::Scr_GetNumParam() >= 1)
{ {
if (Game::Scr_GetInt(0)) if (Game::Scr_GetInt(0))
{ {

View File

@ -495,7 +495,7 @@ namespace Components
return ""; return "";
} }
const auto value = &Game::scrVmPub->top[-index]; const auto* value = &Game::scrVmPub->top[-index];
if (value->type != Game::scrParamType_t::VAR_FUNCTION) if (value->type != Game::scrParamType_t::VAR_FUNCTION)
{ {

View File

@ -189,14 +189,14 @@ namespace Components
Script::AddFunction("IsArray", [] // gsc: iw4x_IsArray(<object>) Script::AddFunction("IsArray", [] // gsc: iw4x_IsArray(<object>)
{ {
const auto type = Game::Scr_GetType(0); auto type = Game::Scr_GetType(0);
bool result; bool result;
if (type == Game::VAR_POINTER) if (type == Game::VAR_POINTER)
{ {
const auto ptr_type = Game::Scr_GetPointerType(0); type = Game::Scr_GetPointerType(0);
assert(ptr_type >= Game::FIRST_OBJECT); assert(type >= Game::FIRST_OBJECT);
result = (ptr_type == Game::VAR_ARRAY); result = (type == Game::VAR_ARRAY);
} }
else else
{ {

View File

@ -73,7 +73,7 @@ namespace Components
if (i + size >= sizeof(cmpData)) if (i + size >= sizeof(cmpData))
{ {
Logger::Print("Error: Writing compressed demo baseline exceeded buffer\n"); Logger::PrintError(Game::CON_CHANNEL_ERROR, "Writing compressed demo baseline exceeded buffer\n");
break; break;
} }

View File

@ -52,6 +52,7 @@ namespace Components
if (name == nullptr) if (name == nullptr)
{ {
Game::Scr_ParamError(0, "^1SetName: Illegal parameter!\n"); Game::Scr_ParamError(0, "^1SetName: Illegal parameter!\n");
return;
} }
Logger::Debug("Setting name of {} to {}", ent->s.number, name); Logger::Debug("Setting name of {} to {}", ent->s.number, name);
@ -76,6 +77,7 @@ namespace Components
if (clanName == nullptr) if (clanName == nullptr)
{ {
Game::Scr_ParamError(0, "^1SetClanTag: Illegal parameter!\n"); Game::Scr_ParamError(0, "^1SetClanTag: Illegal parameter!\n");
return;
} }
Logger::Debug("Setting clanName of {} to {}", ent->s.number, clanName); Logger::Debug("Setting clanName of {} to {}", ent->s.number, clanName);