From 00b4c91686f66f34452f110e2258a19d215a98a3 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Fri, 19 Jan 2024 23:19:26 +0800 Subject: [PATCH] [bot] Rename CNPCMode to CGameMode --- bot/bot.vcproj | 12 ++++++------ bot/gamemodes.cpp | 8 ++++++++ bot/gamemodes.h | 18 ++++++++++++++++++ bot/main.h | 2 +- bot/net/netgame.cpp | 2 +- bot/net/netgame.h | 2 +- bot/npcmode.cpp | 12 ------------ bot/npcmode.h | 12 ------------ 8 files changed, 35 insertions(+), 33 deletions(-) create mode 100644 bot/gamemodes.cpp create mode 100644 bot/gamemodes.h delete mode 100644 bot/npcmode.cpp delete mode 100644 bot/npcmode.h diff --git a/bot/bot.vcproj b/bot/bot.vcproj index 4be15ce..8bf9974 100644 --- a/bot/bot.vcproj +++ b/bot/bot.vcproj @@ -227,18 +227,18 @@ + + + + - - - - diff --git a/bot/gamemodes.cpp b/bot/gamemodes.cpp new file mode 100644 index 0000000..423533f --- /dev/null +++ b/bot/gamemodes.cpp @@ -0,0 +1,8 @@ + +#include "main.h" + +CGameMode::CGameMode() +{ + field_68 = 0; + field_69 = 0; +} diff --git a/bot/gamemodes.h b/bot/gamemodes.h new file mode 100644 index 0000000..444aa7a --- /dev/null +++ b/bot/gamemodes.h @@ -0,0 +1,18 @@ + +#ifndef SAMPNPC_GAMEMODES_H +#define SAMPNPC_GAMEMODES_H + +class CGameMode // size: 110 +{ +private: + char _gap0[104]; + char field_68; + char field_69; + float field_6A; + +public: + CGameMode(); + +}; + +#endif diff --git a/bot/main.h b/bot/main.h index ab8ca00..c575304 100644 --- a/bot/main.h +++ b/bot/main.h @@ -37,7 +37,7 @@ typedef unsigned short PLAYERID; typedef unsigned short VEHICLEID; #include "scrtimers.h" -#include "npcmode.h" +#include "gamemodes.h" #include "net/netrpc.h" #include "net/playerpool.h" diff --git a/bot/net/netgame.cpp b/bot/net/netgame.cpp index dc32559..96355b9 100644 --- a/bot/net/netgame.cpp +++ b/bot/net/netgame.cpp @@ -80,7 +80,7 @@ void CNetGame::Init(PCHAR szHostOrIp, int iPort, strncpy(m_szHostOrIp, szHostOrIp, sizeof(m_szHostOrIp)); m_iPort = iPort; - m_pNPCMode = new CNPCMode(); + m_pGameMode = new CGameMode(); m_pScriptTimers = new CScriptTimers(); // Setup player pool diff --git a/bot/net/netgame.h b/bot/net/netgame.h index b77f3c5..6cffdf2 100644 --- a/bot/net/netgame.h +++ b/bot/net/netgame.h @@ -43,7 +43,7 @@ private: char m_szHostOrIp[128]; int m_iPort; - CNPCMode* m_pNPCMode; + CGameMode* m_pGameMode; CScriptTimers* m_pScriptTimers; public: diff --git a/bot/npcmode.cpp b/bot/npcmode.cpp deleted file mode 100644 index c6d0f6f..0000000 --- a/bot/npcmode.cpp +++ /dev/null @@ -1,12 +0,0 @@ - -// Now the question is, is this called CGameMode or something else? -// It is basically the same as what the server has with minor differences - -#include "npcmode.h" - -CNPCMode::CNPCMode() -{ - // TODO: CNPCMode::CNPCMode W: 0041A9C0 L: 080A940C - field_68 = 0; - field_69 = 0; -} diff --git a/bot/npcmode.h b/bot/npcmode.h deleted file mode 100644 index d4e5fd0..0000000 --- a/bot/npcmode.h +++ /dev/null @@ -1,12 +0,0 @@ - -class CNPCMode // size: 110 -{ -private: - char _gap0[104]; - char field_68; - char field_69; - float field_6A; - -public: - CNPCMode(); -}; \ No newline at end of file