From 7e0bd528fae58d909bc663e8c01590b1362968ad Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Mon, 15 Jan 2024 23:52:08 +0800 Subject: [PATCH] [bot] Update CVehiclePool ctor --- bot/main.h | 3 +++ bot/net/vehiclepool.cpp | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/bot/main.h b/bot/main.h index a880be5..ab8ca00 100644 --- a/bot/main.h +++ b/bot/main.h @@ -14,6 +14,7 @@ #define MAX_PLAYER_NAME 24 #define MAX_PLAYERS 1000 +#define MAX_VEHICLES 2000 #define MAX_SETTINGS_STRING 256 typedef struct _GAME_SETTINGS { @@ -33,6 +34,8 @@ typedef struct _GAME_SETTINGS { #include "../raknet/SAMPRPC.h" typedef unsigned short PLAYERID; +typedef unsigned short VEHICLEID; + #include "scrtimers.h" #include "npcmode.h" diff --git a/bot/net/vehiclepool.cpp b/bot/net/vehiclepool.cpp index 296c477..ce0411a 100644 --- a/bot/net/vehiclepool.cpp +++ b/bot/net/vehiclepool.cpp @@ -1,10 +1,14 @@ -#include "vehiclepool.h" +#include "../main.h" + +//---------------------------------------------------- CVehiclePool::CVehiclePool() { - // TODO: CVehiclePool::CVehiclePool W: 0041A890 L: 080B9408 - for(unsigned short i = 0; i < 2000; i++) { - field_84D0[i] = 0; + // loop through and initialize all net players to null and slot states to false + for(VEHICLEID VehicleID = 0; VehicleID < MAX_VEHICLES; VehicleID++) { + field_84D0[VehicleID] = 0; } } + +//----------------------------------------------------