Bugzilla – Bug 3394
ns_remove_upgrade() does not work.
Last modified: 2015-08-13 04:29:38 PDT
I was hoping to use this native for a thing I am working on but after testing it out I have determined this just does not work (at all). http://svn.alliedmods.net/viewvc.cgi?view=rev&root=amxmodx&revision=3714
I wrote an amxx plugint o use this function as well. The function does not work. My plugin removes an upgrade from a marine whenever he dies (sg/hmg/gl/jp/ha), however this function has no effect. I had originally wrote my own version of ns_remove_upgrade (before sawce included it in the official NS module). I basically ripped off p34ch's code from his metamod module SellUpgrades. Comparing the ns_remove_upgrade included in the official NS module with my working version ripped off from p34ch, I decided to add the following to sawce's version and it's worked fine for me since (both windows and linux servers): if (bfound) { void *pTechTree = (char *)player->GetEdict()->pvPrivateData + OFFSET_COMBATTECHTREE; HLDelegate::MakeDelegate<int, bool, bool>(pTechTree, g_pAvHTechTree_SetResearchDone, params[2], false); if (afound) { return 2; } return 1; }
Commit pushed to master at https://github.com/alliedmodders/amxmodx https://github.com/alliedmodders/amxmodx/commit/20201290e334133d335542b9a6dee6061d998b5c Merge pull request #271 from Arkshine/fix/ns_remove_upgrade Fix ns_remove_upgrade() native (bug 3394)