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

Solved Weird issue with methodmaps


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chrissy
Member
Join Date: May 2013
Old 10-29-2019 , 16:29   Weird issue with methodmaps
Reply With Quote #1

I have this:

Code:
public void RemovePluginZoneTypes(const char[] sPlugin)
	{
		ZoneTypeObject ZoneType;
	
		PrintToChatAll("this.length = %d", this.Length);
	
		for(int i; i < this.Length; i++)
		{
			this.GetArray(i, ZoneType);
			
			PrintToChatAll("i = %d", i);
			
			if(StrEqual(sPlugin, ZoneType.Plugin))
			{
				this.Erase(i);
				
				PrintToChatAll("Zone type by %s was found, removed.", sPlugin);
			}
		}
	}
I expect it to iterate for 3 times, as is the length. But it only iterates 2 times. (The if statements is true for each iteration)

I assume each time an index is erased the length is smaller. Am i miss understanding or is that value not static? I swear I've done similar things with ArrayLists without issue.

Edit: Ran a test with C++ and turns out it does change the value. Looks like I need to review some of my plugins then. Sorry for the waste of a post.

Last edited by DarkDeviL; 11-01-2019 at 03:27. Reason: Restore to previous version. + Solved tag
Chrissy is offline
Reply



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 07:08.


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