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

Data is persistent over map changes, when I don't want it to be


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
yellowblood
Member
Join Date: May 2010
Old 12-08-2011 , 15:04   Data is persistent over map changes, when I don't want it to be
Reply With Quote #1

Hey,

I have a simple TF2 plugins that deals with balancing teams.

Sadly, it keeps some data between maps and it causes some bugs. In other words, the method that clears this data isn't called -
Code:
public OnMapStart()
{
	if (_enabled) Enable();
}

public Enable()
{
	ServerCommand("mp_autoteambalance 0");
	ServerCommand("mp_teams_unbalance_limit 0");
	
	_isShouldBalance = false;
	_winningTeam = 0;
	_teamWins[TEAM_RED] = 0;
	_teamWins[TEAM_BLUE] = 0;

	for (new i = 0; i < sizeof(_playerKills) ; i++)
	{
		_playerKills[i] = 0;
		_playerTeams[i] = 0;
	}
}
What am I missing? I want the "Enable" method to be called every time a map changes, so the plugin will start fresh.

Thanks
yellowblood is offline
 



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 17:18.


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