Raised This Month: $12 Target: $400
 3% 

datamaps expanding


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 06-04-2016 , 15:53   datamaps expanding
Reply With Quote #1

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 ?

Last edited by kadet.89; 06-04-2016 at 15:55.
kadet.89 is offline
Send a message via Skype™ to kadet.89
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-04-2016 , 19:25   Re: datamaps expanding
Reply With Quote #2

Datamaps and netprops just map to member variables on the class, you can't add additional ones as there is no place for storage.
__________________
asherkin is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:48.


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