Add prediction for Tech Disks, cleanup (#29061)

* Add prediction for Tech Disks, cleanup

* Remove IsServer check in OnMapInit

* Use HashSet for techs, remove LINQ
This commit is contained in:
Tayrtahn
2024-06-19 11:04:30 -04:00
committed by GitHub
parent 20544b0c76
commit 024521b66b
6 changed files with 137 additions and 131 deletions

View File

@@ -131,25 +131,6 @@ public sealed partial class ResearchSystem
RaiseLocalEvent(uid, ref ev);
}
/// <summary>
/// Adds a lathe recipe to the specified technology database
/// without checking if it can be unlocked.
/// </summary>
public void AddLatheRecipe(EntityUid uid, string recipe, TechnologyDatabaseComponent? component = null)
{
if (!Resolve(uid, ref component))
return;
if (component.UnlockedRecipes.Contains(recipe))
return;
component.UnlockedRecipes.Add(recipe);
Dirty(uid, component);
var ev = new TechnologyDatabaseModifiedEvent();
RaiseLocalEvent(uid, ref ev);
}
/// <summary>
/// Returns whether a technology can be unlocked on this database,
/// taking parent technologies into account.