实体
对象池 CPools
查看 Markdown句柄互转与池指针
CPools.h
跨帧存 handle,再用 Get* 取指针。池满会创建失败。
脚本句柄 → 指针。无效 null。
static CPed* GetPed(int handle);
static CVehicle* GetVehicle(int handle);
static CObject* GetObject(int handle);static int GetPedRef(CPed* ped);
static int GetVehicleRef(CVehicle* vehicle);
static int GetObjectRef(CObject* object);static CPool<CPed, CCopPed*>& ms_pPedPool;
static CPool<CVehicle, CHeli*>& ms_pVehiclePool;
static CPool<CObject, CCutsceneObject*>& ms_pObjectPool;
static CPool<CBuilding*>& ms_pBuildingPool;
static CPool<CDummy*>& ms_pDummyPool;任务槽紧,别泄漏 Task。
static CPool<CTask, char[128]*>& ms_pTaskPool;
static CPool<CPedIntelligence*>& ms_pPedIntelligencePool;
static CPool<CColModel*>& ms_pColModelPool;
static CPool<CPtrNodeSingleLink*>& ms_pPtrNodeSingleLinkPool;
static CPool<CPtrNodeDoubleLink*>& ms_pPtrNodeDoubleLinkPool;一般只读;改存档流程要极谨慎。
static bool Save();
static bool Load();
static bool SavePedPool();
static bool LoadPedPool();
// Vehicle / Object 同理
static void MakeSureSlotInObjectPoolIsEmpty(int slot);
评论