Construction Bugfixes (#1329)

* Added: CanReach property to AfterAttack events which signals if the attack was within reach.
Fixed: You cannot construct/deconstruct things out of reach.
Fixed: Construction entities now preserve transform rotation.
Fixed: No more exceptions about missing grids when constructing world entities.
Fixed: Used the proper intermediate sprite for intermediate entities.
Fixed: Issue with missing sprite layers on ghost.

* The alligator is greedy, he always eats the bigger number...

* Adds a check so that you cannot use tools on entities that are obstructed from view.
This commit is contained in:
Acruid
2020-07-10 16:52:07 -07:00
committed by GitHub
parent 89c111664a
commit b6b31b7294
4 changed files with 47 additions and 19 deletions

View File

@@ -158,11 +158,13 @@ namespace Content.Client.GameObjects.EntitySystems
comp.Prototype = prototype;
comp.GhostID = _nextId++;
ghost.Transform.LocalRotation = dir.ToAngle();
var sprite = ghost.GetComponent<SpriteComponent>();
sprite.LayerSetSprite(0, prototype.Icon);
sprite.LayerSetVisible(0, true);
_ghosts.Add(comp.GhostID, comp);
var sprite = ghost.GetComponent<SpriteComponent>();
sprite.Color = new Color(48, 255, 48, 128);
sprite.AddBlankLayer(0); // There is no way to actually check if this already exists, so we blindly insert a new one
sprite.LayerSetSprite(0, prototype.Icon);
sprite.LayerSetShader(0, "unshaded");
sprite.LayerSetVisible(0, true);
}
private void TryStartConstruction(int ghostId)