Change over solar panel breakage to use more construction graphs (#5395)

This commit is contained in:
20kdc
2021-11-26 09:17:21 +00:00
committed by GitHub
parent d4947bfb86
commit f0f913f5bc
4 changed files with 82 additions and 61 deletions

View File

@@ -154,7 +154,6 @@ namespace Content.Server.Solar.EntitySystems
if (coverage > 0)
{
// Determine if the solar panel is occluded, and zero out coverage if so.
// FIXME: The "Opaque" collision group doesn't seem to work right now.
var ray = new CollisionRay(entity.Transform.WorldPosition, TowardsSun.ToWorldVec(), (int) CollisionGroup.Opaque);
var rayCastResults = _physicsSystem.IntersectRayWithPredicate(
entity.Transform.MapID,
@@ -167,9 +166,10 @@ namespace Content.Server.Solar.EntitySystems
// Total coverage calculated; apply it to the panel.
panel.Coverage = coverage;
UpdateSupply(panel.OwnerUid, panel);
}
private void UpdateSupply(
public void UpdateSupply(
EntityUid uid,
SolarPanelComponent? solar = null,
PowerSupplierComponent? supplier = null)