AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   datamaps expanding (https://forums.alliedmods.net/showthread.php?t=283518)

kadet.89 06-04-2016 15:53

datamaps expanding
 
I need to add some new fields to the CKnife - weapon_knife. As I can see datamap array is like a list, so each datamap_t struct contains a pointer to the next one, does it mean that I can append my own datamaps to this array this way?

PHP Code:

unsigned int UTIL_FindInDataMap(datamap_t *pMap, const char *name)
{
    while (
pMap)
    {
        
//staff
        
pMap pMap->baseMap;
    }
    
pMap->baseMap = new datamap_t;
    
//....
    
pMap->baseMap->baseMap =NULL;
    return 
0


Will this work, work with sm functions?
And the last question. Each entity has own storage buffer for datamaps, is the size of the buffer limited with the last datamap offset (m_hEffectEntity) or there is a reserved space, and I can write over the last datamap offset m_hEffectEntity, use the unmapped space for my own datamaps ?

asherkin 06-04-2016 19:25

Re: datamaps expanding
 
Datamaps and netprops just map to member variables on the class, you can't add additional ones as there is no place for storage.


All times are GMT -4. The time now is 10:19.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.