mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[saco] Implement/match CLabelPool::Delete(...)
* Update CLabelPool constructor
This commit is contained in:
parent
becf308a1c
commit
61936ebf93
@ -3,9 +3,22 @@
|
||||
|
||||
CLabelPool::CLabelPool()
|
||||
{
|
||||
for(WORD wLabel = 0; wLabel < MAX_LABELS; wLabel++)
|
||||
for(WORD wLabelID = 0; wLabelID < MAX_LABELS; wLabelID++)
|
||||
{
|
||||
memset(&field_0[wLabel], 0, sizeof(struc_92));
|
||||
field_E800[wLabel] = 0;
|
||||
memset(&m_Labels[wLabelID], 0, sizeof(LABEL));
|
||||
m_bLabelSlotState[wLabelID] = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CLabelPool::Delete(WORD wLabelID)
|
||||
{
|
||||
if(wLabelID >= MAX_LABELS) return FALSE;
|
||||
if(!m_bLabelSlotState[wLabelID]) return FALSE;
|
||||
|
||||
if(m_Labels[wLabelID].szText)
|
||||
free(m_Labels[wLabelID].szText);
|
||||
memset(&m_Labels[wLabelID], 0, sizeof(LABEL));
|
||||
m_bLabelSlotState[wLabelID] = FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1,17 +1,20 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
struct struc_92
|
||||
typedef struct _LABEL
|
||||
{
|
||||
char _gap[29];
|
||||
};
|
||||
char *szText;
|
||||
char _gap4[25];
|
||||
} LABEL;
|
||||
|
||||
class CLabelPool
|
||||
{
|
||||
private:
|
||||
struc_92 field_0[MAX_LABELS];
|
||||
int field_E800[MAX_LABELS];
|
||||
LABEL m_Labels[MAX_LABELS];
|
||||
BOOL m_bLabelSlotState[MAX_LABELS];
|
||||
public:
|
||||
CLabelPool();
|
||||
|
||||
BOOL Delete(WORD wLabelID);
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user