Bug 3394 - ns_remove_upgrade() does not work.
ns_remove_upgrade() does not work.
Status: RESOLVED FIXED
Product: AMX Mod X
Classification: Unclassified
Component: Addon: Natural Selection
trunk
PC All
: P3 major
Assigned To: amxmodx-bugs@alliedmods.net
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-04 15:33 PST by TinCan
Modified: 2015-08-13 04:29 PDT (History)
3 users (show)

See Also:


Attachments

Description TinCan 2008-11-04 15:33:56 PST
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
Comment 1 asmodee 2008-11-07 20:13:28 PST
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;
	}
Comment 2 AM Bugzilla Bot 2015-08-10 06:28:49 PDT
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)

Note You need to log in before you can comment on or make changes to this bug.