From ddedffd121dc6350ca2466b84ae4d652095bdb0d Mon Sep 17 00:00:00 2001 From: miniduikboot Date: Sun, 20 Jun 2021 21:44:18 +0200 Subject: [PATCH] Refactor Polus meeting room spawning logic Also adjust the constants to the new constants used in game --- .../Objects/ShipStatus/InnerPolusShipStatus.cs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) 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) -- 2.39.5