Skip to content

Commit 413f4ff

Browse files
committed
Reducing bug prone codes
1 parent ebb948f commit 413f4ff

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

dlls/bot_commands.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ void player(entvars_t* pev)
7676
#else
7777
extern void* h_Library;
7878
#endif
79-
static LINK_ENTITY_FUNC otherClassName = NULL;
80-
if (otherClassName == NULL)
79+
static LINK_ENTITY_FUNC otherClassName = nullptr;
80+
if (otherClassName == nullptr)
8181
otherClassName = (LINK_ENTITY_FUNC)GetProcAddress(h_Library, "player");
82-
if (otherClassName != NULL)
82+
if (otherClassName != nullptr)
8383
{
8484
(*otherClassName)(pev);
8585
}
@@ -235,7 +235,7 @@ eBotCvarState CUtilCommand::action(CClient* pClient, const char* arg1, const cha
235235
if (arg3 && *arg3)
236236
iWpt = std::atoi(arg3);
237237
else
238-
iWpt = WaypointLocations.NearestWaypoint(pClient->GetPlayer()->v.origin, 100, -1);
238+
iWpt = WaypointLocations.NearestWaypoint(pClient->GetPlayer()->v.origin, 100.0f, -1);
239239

240240
pBot->ClearTasks();
241241

dlls/bot_const.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,17 +1236,17 @@ enum : std::uint8_t
12361236
#ifdef RCBOT_META_BUILD
12371237

12381238
#ifdef _DEBUG
1239-
constexpr const char* BOT_VER = "1.51b13_mm_debug";
1239+
constexpr const char* BOT_VER = "1.51b14_mm_debug";
12401240
#else
1241-
constexpr const char* BOT_VER = "1.51b13_mm";
1241+
constexpr const char* BOT_VER = "1.51b14_mm";
12421242
#endif
12431243

12441244
#else
12451245

12461246
#ifdef _DEBUG
1247-
constexpr const char* BOT_VER = "1.51b13_debug";
1247+
constexpr const char* BOT_VER = "1.51b14_debug";
12481248
#else
1249-
constexpr const char* BOT_VER = "1.51b13";
1249+
constexpr const char* BOT_VER = "1.51b14";
12501250
#endif
12511251

12521252
#endif
@@ -1260,17 +1260,17 @@ constexpr const char* BOT_VER = "1.51b13";
12601260
#ifdef RCBOT_META_BUILD
12611261

12621262
#ifdef _DEBUG
1263-
constexpr const char* BOT_VER = "1.51b13_mm_debug";
1263+
constexpr const char* BOT_VER = "1.51b14_mm_debug";
12641264
#else
1265-
constexpr const char* BOT_VER = "1.51b13_mm";
1265+
constexpr const char* BOT_VER = "1.51b14_mm";
12661266
#endif
12671267

12681268
#else
12691269

12701270
#ifdef _DEBUG
1271-
constexpr const char* BOT_VER = "1.51b13_debug";
1271+
constexpr const char* BOT_VER = "1.51b14_debug";
12721272
#else
1273-
constexpr const char* BOT_VER = "1.51b13";
1273+
constexpr const char* BOT_VER = "1.51b14";
12741274
#endif
12751275

12761276
#endif

dlls/dll.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1511,7 +1511,7 @@ int EXPORT GetNewDLLFunctions(NEW_DLL_FUNCTIONS* pFunctionTable, int* interfaceV
15111511
extern "C" EXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS* pFunctionTable, int* interfaceVersion)
15121512
#endif
15131513
{
1514-
if (other_GetNewDLLFunctions == NULL)
1514+
if (other_GetNewDLLFunctions == nullptr)
15151515
return false;
15161516

15171517
// pass other DLLs engine callbacks to function table...

dlls/globals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ void CBotGlobals::LoadBotModels()
13791379
std::strcat(path, "\\models\\player");
13801380
#endif
13811381

1382-
if (stat(path, &stat_str) != 0)
1382+
if (stat(path, &stat_str) != 0 /*|| !HasSubDirectories(path)*/) //HasSubDirectories(path) fails on dedi servers? [APG]RoboCop[CL]
13831383
{
13841384
// use the valve/models/player directory if no valid MOD models/player
13851385
#ifdef __linux__

dlls/util.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ int GetMessageID(const char* szMsg)
577577
int msg_id = -1;
578578

579579
#ifndef RCBOT_META_BUILD
580-
CBotNetMessage* msg = NULL;
580+
CBotNetMessage* msg = nullptr;
581581
msg = gBotGlobals.m_NetEntityMessages.GetMessage(0, szMsg);
582582
if (msg)
583583
msg_id = msg->MessageNum();
@@ -859,11 +859,11 @@ int UTIL_GetNumClients(const bool bReport)
859859
#ifdef DEBUG
860860
edict_t* DBG_EntOfVars(const entvars_t* pev)
861861
{
862-
if (pev->pContainingEntity != NULL)
862+
if (pev->pContainingEntity != nullptr)
863863
return pev->pContainingEntity;
864864
ALERT(at_console, "entvars_t pContainingEntity is NULL, calling into engine");
865865
edict_t* pent = (*g_engfuncs.pfnFindEntityByVars)((entvars_t*)pev);
866-
if (pent == NULL)
866+
if (pent == nullptr)
867867
ALERT(at_console, "DAMN! Even the engine couldn't FindEntityByVars!");
868868
((entvars_t*)pev)->pContainingEntity = pent;
869869
return pent;

0 commit comments

Comments
 (0)