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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user