Changeset - r11212:ef73b4ad95ab
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-02-24 13:25:35
rubidium@openttd.org
(svn r15565) -Fix [FS#2675]: dependency information wasn't requested after the content state was reset causing the dependencies not always being selected (and thus downloaded) automatically.
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/network/network_content.cpp
Show inline comments
 
@@ -733,48 +733,49 @@ void ClientNetworkContentSocketHandler::
 
		}
 

	
 
		/* So something depended directly on us */
 
		if (force_selection) continue;
 

	
 
		/* Nothing depends on us, mark the whole graph as unselected.
 
		 * After that's done run over them once again to test their children
 
		 * to unselect. Don't do it immediatelly because it'll do exactly what
 
		 * we're doing now. */
 
		for (ConstContentIterator iter = parents.Begin(); iter != parents.End(); iter++) {
 
			const ContentInfo *c = *iter;
 
			if (c->state == ContentInfo::AUTOSELECTED) this->Unselect(c->id);
 
		}
 
		for (ConstContentIterator iter = parents.Begin(); iter != parents.End(); iter++) {
 
			this->CheckDependencyState(this->GetContent((*iter)->id));
 
		}
 
	}
 
}
 

	
 
void ClientNetworkContentSocketHandler::Clear()
 
{
 
	for (ContentIterator iter = this->infos.Begin(); iter != this->infos.End(); iter++) delete *iter;
 

	
 
	this->infos.Clear();
 
	this->requested.Clear();
 
}
 

	
 
/*** CALLBACK ***/
 

	
 
void ClientNetworkContentSocketHandler::OnConnect(bool success)
 
{
 
	for (ContentCallback **iter = this->callbacks.Begin(); iter != this->callbacks.End(); /* nothing */) {
 
		ContentCallback *cb = *iter;
 
		cb->OnConnect(success);
 
		if (iter != this->callbacks.End() && *iter == cb) iter++;
 
	}
 
}
 

	
 
void ClientNetworkContentSocketHandler::OnDisconnect()
 
{
 
	for (ContentCallback **iter = this->callbacks.Begin(); iter != this->callbacks.End(); /* nothing */) {
 
		ContentCallback *cb = *iter;
 
		cb->OnDisconnect();
 
		if (iter != this->callbacks.End() && *iter == cb) iter++;
 
	}
 
}
 

	
 
void ClientNetworkContentSocketHandler::OnReceiveContentInfo(const ContentInfo *ci)
 
{
0 comments (0 inline, 0 general)