mirror of https://github.com/OpenTTD/OpenTTD
Codefix: Change method to take const pointer instead of using const_cast. (#13525)
parent
7fbfaa1b54
commit
e80992fc47
|
@ -173,7 +173,7 @@ bool ClientNetworkContentSocketHandler::Receive_SERVER_INFO(Packet &p)
|
|||
ConstContentVector parents;
|
||||
this->ReverseLookupTreeDependency(parents, ci);
|
||||
for (const ContentInfo *ici : parents) {
|
||||
this->CheckDependencyState(const_cast<ContentInfo *>(ici));
|
||||
this->CheckDependencyState(ici);
|
||||
}
|
||||
|
||||
this->OnReceiveContentInfo(ci);
|
||||
|
@ -973,7 +973,7 @@ void ClientNetworkContentSocketHandler::ReverseLookupTreeDependency(ConstContent
|
|||
* Check the dependencies (recursively) of this content info
|
||||
* @param ci the content info to check the dependencies of
|
||||
*/
|
||||
void ClientNetworkContentSocketHandler::CheckDependencyState(ContentInfo *ci)
|
||||
void ClientNetworkContentSocketHandler::CheckDependencyState(const ContentInfo *ci)
|
||||
{
|
||||
if (ci->IsSelected() || ci->state == ContentInfo::ALREADY_HERE) {
|
||||
/* Selection is easy; just walk all children and set the
|
||||
|
|
|
@ -130,7 +130,7 @@ public:
|
|||
|
||||
void ReverseLookupDependency(ConstContentVector &parents, const ContentInfo *child) const;
|
||||
void ReverseLookupTreeDependency(ConstContentVector &tree, const ContentInfo *child) const;
|
||||
void CheckDependencyState(ContentInfo *ci);
|
||||
void CheckDependencyState(const ContentInfo *ci);
|
||||
|
||||
/** Get the number of content items we know locally. */
|
||||
uint Length() const { return (uint)this->infos.size(); }
|
||||
|
|
Loading…
Reference in New Issue