1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-22 19:54:06 +01:00

Codefix: Change method to take const pointer instead of using const_cast. (#13525)

This commit is contained in:
Peter Nelson
2025-02-10 22:10:36 +00:00
committed by GitHub
parent 7fbfaa1b54
commit e80992fc47
2 changed files with 3 additions and 3 deletions

View File

@@ -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