- 
 
- 
  Notifications
 You must be signed in to change notification settings 
- Fork 496
Added dynamic ped ID allocating(based on lopezloo pull request) #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good work 👍
Some minor things:
- (void) is pointless, just remove the void there
- nullptr should be preferred to NULL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strModelType == "ped" would be better here. No real need to make it case-insensitive or use C functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are already doing m_pModelManager->Add ( this ); in the constructor of CClientModel.
Ideally we'd eliminate the use of new entirely and just use unique_ptrs for the managers in general to avoid memleaks entirely.
 
 
 Client/game_sa/CModelInfoSA.cpp
 
 Outdated
 
 
 There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you check whether all peds always have a colmodel VAR_CTempColModels_ModelPed1? The 1 seems to imply there might be more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about that. That was based on lopez research.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there is only one collision? Seems weird...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to end the topic - GTA is using hardcoded ped collision, so all peds are using the same collision. @sbx320
"GTA is using hardcoded ped collision, so all peds are using the same collision"
 
 
 
 Necktrox
 
 
 
 commented
 Feb 18, 2018 
 
 
 
During testing I noticed that you can leak model IDs when you execute the /allocate commands multiple times. Restarting the resource doesn't deallocate the allocated IDs, which should be done by MTA, not the resource.
@Necktrox Fixed.
BTW. It is almost year later... I'm lazy guy. :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a better name might be SetParentResource with a comment "This is the resource that allocated this model"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use nullptr wherever possible now
@qaisjp Is everything fine now?
 
 
 
 dretax
 
 
 
 commented
 Sep 1, 2018 
 
 
 
Heh. Nice one.
Uh oh!
There was an error while loading. Please reload this page.
Authors: @lopezloo, @Neproify, @ArranTuna
Dynamic ped ID allocation based on @lopezloo pull request - #65
With api proposed by @sbx320
Functions:
engineRequestModel(string type)
engineFreeModel(int modelID)
How it looks like?
mta-screen_2017年06月28日_20-43-37
mta-screen_2017年06月28日_20-43-42
Test resource:
testresource.tar.gz