From: miniduikboot Date: Sun, 20 Jun 2021 19:44:18 +0000 (+0200) Subject: Refactor Polus meeting room spawning logic X-Git-Tag: v1.5.0~7^2~1 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=ddedffd121dc6350ca2466b84ae4d652095bdb0d;p=rhonda%2Fimpostor.git Refactor Polus meeting room spawning logic Also adjust the constants to the new constants used in game --- diff --git a/src/Impostor.Server/Net/Inner/Objects/ShipStatus/InnerPolusShipStatus.cs b/src/Impostor.Server/Net/Inner/Objects/ShipStatus/InnerPolusShipStatus.cs index c7ccc22..4ba0490 100644 --- a/src/Impostor.Server/Net/Inner/Objects/ShipStatus/InnerPolusShipStatus.cs +++ b/src/Impostor.Server/Net/Inner/Objects/ShipStatus/InnerPolusShipStatus.cs @@ -24,9 +24,9 @@ namespace Impostor.Server.Net.Inner.Objects.ShipStatus public override Vector2 InitialSpawnCenter { get; } = new Vector2(16.64f, -2.46f); - public override Vector2 MeetingSpawnCenter { get; } = new Vector2(17.726f, -16.286f); + public override Vector2 MeetingSpawnCenter { get; } = new Vector2(17.4f, -16.286f); - public Vector2 MeetingSpawnCenter2 { get; } = new Vector2(-17.7f, -17.5f); + public Vector2 MeetingSpawnCenter2 { get; } = new Vector2(17.4f, -17.515f); public override Vector2 GetSpawnLocation(InnerPlayerControl player, int numPlayers, bool initialSpawn) { @@ -35,19 +35,16 @@ namespace Impostor.Server.Net.Inner.Objects.ShipStatus return base.GetSpawnLocation(player, numPlayers, initialSpawn); } - Vector2 position; - int halfPlayers = numPlayers / 2; // floored intentionally - int spawnId = player.PlayerId % 15; + var halfPlayers = numPlayers / 2; // floored intentionally + var spawnId = player.PlayerId % 15; if (player.PlayerId < halfPlayers) { - position = this.MeetingSpawnCenter + (new Vector2(0.6f, 0) * spawnId); + return this.MeetingSpawnCenter + (new Vector2(0.6f, 0) * spawnId); } else { - position = this.MeetingSpawnCenter2 + (new Vector2(0.6f, 0) * (spawnId - halfPlayers)); + return this.MeetingSpawnCenter2 + (new Vector2(0.6f, 0) * (spawnId - halfPlayers)); } - - return position; } protected override void AddSystems(Dictionary systems)