Revert unnecessary changes made by previous PR to SolutionCompon… (#583)
#574 added an out arg to `SolutionComponent.TryRemoveSolution` containing the solution that was removed. I made this change since I thought there was no way to get the removed solution for further use. Didn't notice `SplitSolution` which provides nearly the same behavior. With this PR I want to remove that out arg from `TryRemoveSolution` to keep the SolutionComponent API simple and to avoid having multiple ways of doing things. Existing code uses `SplitSolution`, I just wasn't paying attention. Feel free to deny merging this if I'm over thinking it. I think it'll help keep solution code from becoming a mess.
This commit is contained in:
@@ -76,11 +76,9 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
||||
_localizationManager.GetString("Container is full"));
|
||||
return false;
|
||||
}
|
||||
//Remove transfer amount from attacker
|
||||
if (!attackSolution.TryRemoveSolution(realTransferAmount, out var removedSolution))
|
||||
return false;
|
||||
|
||||
//Add poured solution to this solution
|
||||
//Move units from attackSolution to targetSolution
|
||||
var removedSolution = attackSolution.SplitSolution(realTransferAmount);
|
||||
if (!targetSolution.TryAddSolution(removedSolution))
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user