Skip to content

Commit

Permalink
refactor: extract core mod test into a dedicated function
Browse files Browse the repository at this point in the history
  • Loading branch information
Alystrasz committed Aug 9, 2024
1 parent 5b47e98 commit c8d155b
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ void function OnServerSelected_Threaded( var button )
foreach ( requiredModInfo in server.requiredMods )
{
// Tolerate core mods having different versions
if ( requiredModInfo.name.len() > 10 && requiredModInfo.name.slice(0, 10) == "Northstar." )
if ( IsCoreMod( requiredModInfo.name ) )
continue

if ( !modNames.contains( requiredModInfo.name ) )
Expand Down Expand Up @@ -1002,7 +1002,7 @@ void function OnServerSelected_Threaded( var button )
foreach ( RequiredModInfo mod in server.requiredMods )
{
// Tolerate core mods having different versions
if ( mod.name.len() > 10 && mod.name.slice(0, 10) == "Northstar." )
if ( IsCoreMod( mod.name ) )
continue

if ( !NSGetModNames().contains( mod.name ) || !NSGetModVersions( mod.name ).contains( mod.version ) )
Expand Down Expand Up @@ -1375,4 +1375,9 @@ void function TriggerConnectToServerCallbacks( ServerInfo ornull targetServer =
{
callback( expect ServerInfo( targetServer ) )
}
}

bool function IsCoreMod( string modName )
{
return modName.len() > 10 && modName.slice(0, 10) == "Northstar."
}

0 comments on commit c8d155b

Please sign in to comment.