mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-11-23 22:39:39 +00:00
[saco] Implement CVehiclePool ctor
This commit is contained in:
parent
2ae74bd25e
commit
125a453d53
@ -3,8 +3,13 @@
|
|||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
#define MAX_VEHICLES 2000
|
||||||
#define PLAYER_PED_SLOTS 210
|
#define PLAYER_PED_SLOTS 210
|
||||||
|
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
|
||||||
|
typedef unsigned short VEHICLEID;
|
||||||
|
|
||||||
typedef struct _VECTOR {
|
typedef struct _VECTOR {
|
||||||
float X,Y,Z;
|
float X,Y,Z;
|
||||||
} VECTOR, *PVECTOR;
|
} VECTOR, *PVECTOR;
|
||||||
|
@ -30,6 +30,7 @@ typedef struct _GAME_SETTINGS {
|
|||||||
#include "../raknet/GetTime.h"
|
#include "../raknet/GetTime.h"
|
||||||
|
|
||||||
#include "net/netrpc.h"
|
#include "net/netrpc.h"
|
||||||
|
#include "net/vehiclepool.h"
|
||||||
#include "net/netgame.h"
|
#include "net/netgame.h"
|
||||||
#include "net/scriptrpc.h"
|
#include "net/scriptrpc.h"
|
||||||
|
|
||||||
|
@ -32,6 +32,8 @@ CNetGame::CNetGame(PCHAR szHostOrIp, int iPort,
|
|||||||
void CNetGame::InitPools()
|
void CNetGame::InitPools()
|
||||||
{
|
{
|
||||||
m_pPools = (NETGAME_POOLS *)calloc(1, sizeof(NETGAME_POOLS));
|
m_pPools = (NETGAME_POOLS *)calloc(1, sizeof(NETGAME_POOLS));
|
||||||
|
|
||||||
|
m_pPools->pVehiclePool = new CVehiclePool();
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD CNetGame::GetTime()
|
DWORD CNetGame::GetTime()
|
||||||
|
@ -26,7 +26,8 @@ struct struc_41
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _NETGAME_POOLS {
|
typedef struct _NETGAME_POOLS {
|
||||||
char _gap0[0x24];
|
CVehiclePool *pVehiclePool;
|
||||||
|
char _gap0[32];
|
||||||
} NETGAME_POOLS;
|
} NETGAME_POOLS;
|
||||||
|
|
||||||
class CNetGame // size: 994
|
class CNetGame // size: 994
|
||||||
|
20
saco/net/vehiclepool.cpp
Normal file
20
saco/net/vehiclepool.cpp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
#include "../main.h"
|
||||||
|
|
||||||
|
//----------------------------------------------------
|
||||||
|
|
||||||
|
CVehiclePool::CVehiclePool()
|
||||||
|
{
|
||||||
|
// loop through and initialize all vehicle properties to 0
|
||||||
|
for(VEHICLEID VehicleID = 0; VehicleID < MAX_VEHICLES; VehicleID++) {
|
||||||
|
field_3074[VehicleID] = 0;
|
||||||
|
field_1134[VehicleID] = 0;
|
||||||
|
field_4FB4[VehicleID] = 0;
|
||||||
|
field_9DD4[VehicleID] = GetTickCount();
|
||||||
|
}
|
||||||
|
memset(field_FA4, 0, sizeof(field_FA4));
|
||||||
|
field_0 = 0;
|
||||||
|
field_17894 = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------
|
29
saco/net/vehiclepool.h
Normal file
29
saco/net/vehiclepool.h
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
//----------------------------------------------------
|
||||||
|
|
||||||
|
class CVehiclePool
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
int field_0;
|
||||||
|
|
||||||
|
char _gap4[4000];
|
||||||
|
|
||||||
|
char field_FA4[400];
|
||||||
|
int field_1134[MAX_VEHICLES];
|
||||||
|
int field_3074[MAX_VEHICLES];
|
||||||
|
int field_4FB4[MAX_VEHICLES];
|
||||||
|
|
||||||
|
char _gap6EF4[12000];
|
||||||
|
|
||||||
|
DWORD field_9DD4[MAX_VEHICLES];
|
||||||
|
|
||||||
|
char _gapBD14[48000];
|
||||||
|
|
||||||
|
int field_17894;
|
||||||
|
|
||||||
|
CVehiclePool();
|
||||||
|
};
|
||||||
|
|
||||||
|
//----------------------------------------------------
|
@ -258,6 +258,12 @@
|
|||||||
<File
|
<File
|
||||||
RelativePath=".\net\scriptrpc.h">
|
RelativePath=".\net\scriptrpc.h">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\net\vehiclepool.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\net\vehiclepool.h">
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="ttmath"
|
Name="ttmath"
|
||||||
|
Loading…
Reference in New Issue
Block a user