View Single Post
  #3  
Old 10-14-2006, 11:30 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Don't feel like making a new post for one line of code change so... while testing this all out I noticed my faction wasn't raising or lowering on mobs.

in Client::SetFactionLevel() there is:
Code:
			if(tmpValue >= MAX_FACTION)
			{
				t = MAX_FACTION - mod;
				if(current_value == t) {
					//do nothing, it is already maxed out
				} else if(!(database.SetCharacterFactionLevel(char_id, faction_id[i], t, factionvalues)))
				{
					return;
				}
			}
			else if(tmpValue <= MIN_FACTION)
			{
				t = MIN_FACTION - mod;
				if(current_value == t) {
					//do nothing, it is already maxed out
				} else if(!(database.SetCharacterFactionLevel(char_id, faction_id[i], t, factionvalues)))
				{
					return;
				}
			}
			else
			{
				if(!(database.SetCharacterFactionLevel(char_id, faction_id[i], current_value, factionvalues)))
				{
					return;
				}
			}
the issue is down there at the bottom
Code:
if(!(database.SetCharacterFactionLevel(char_id, faction_id[i], current_value, factionvalues)))
You're supposed to be setting the new faction value but you're setting it to the current_value?
should be something like
Code:
if(!(database.SetCharacterFactionLevel(char_id, faction_id[i], current_value+npc_value[i], factionvalues)))
Reply With Quote