Skip to content

Commit

Permalink
fix: remove intro counter because it cannot be added on round start
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalle committed Jan 17, 2025
1 parent 5da146b commit 7cbc9a1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
10 changes: 1 addition & 9 deletions src/MapModifiers+Spawnpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,15 @@ private void SpawnPointsOnRoundStart(EventRoundStart @event, GameEventInfo info)
var playerSpawnEntities = Utilities.FindAllEntitiesByDesignerName<CBaseEntity>("info_player_start").ToArray();
// count ct spawns
var ctSpawnEntities = Utilities.FindAllEntitiesByDesignerName<CBaseEntity>("info_player_counterterrorist").ToArray();
var ctIntroEntities = Utilities.FindAllEntitiesByDesignerName<CBaseEntity>("team_intro_counterterrorist").ToArray();
var ctTeamSpawnEntities = Utilities.FindAllEntitiesByDesignerName<CBaseEntity>("team_select_counterterrorist").ToArray();
// count t spawns
var tSpawnEntities = Utilities.FindAllEntitiesByDesignerName<CBaseEntity>("info_player_terrorist").ToArray();
var tIntroEntities = Utilities.FindAllEntitiesByDesignerName<CBaseEntity>("team_intro_terrorist").ToArray();
var tTeamSpawnEntities = Utilities.FindAllEntitiesByDesignerName<CBaseEntity>("team_select_terrorist").ToArray();
Console.WriteLine(Localizer["spawnpoints.count"].Value
.Replace("{spawns}", playerSpawnEntities.Length.ToString())
.Replace("{ct}", ctSpawnEntities.Length.ToString())
.Replace("{ctintro}", ctIntroEntities.Length.ToString())
.Replace("{ctteamselect}", ctTeamSpawnEntities.Length.ToString())
.Replace("{t}", tSpawnEntities.Length.ToString())
.Replace("{tintro}", tIntroEntities.Length.ToString())
.Replace("{tteamselect}", tTeamSpawnEntities.Length.ToString())
.Replace("{maxplayers}", Server.MaxPlayers.ToString()));
if ((playerSpawnEntities.Length
Expand All @@ -42,14 +38,10 @@ private void SpawnPointsOnRoundStart(EventRoundStart @event, GameEventInfo info)
SendGlobalChatMessage(message);
}
if (ctTeamSpawnEntities.Length < 1
|| ctIntroEntities.Length < 1
|| tTeamSpawnEntities.Length < 1
|| tIntroEntities.Length < 1)
|| tTeamSpawnEntities.Length < 1)
{
var message = Localizer["spawnpoints.countteamspawns.warning"].Value
.Replace("{ctintro}", ctIntroEntities.Length.ToString())
.Replace("{ctteamselect}", ctTeamSpawnEntities.Length.ToString())
.Replace("{tintro}", tIntroEntities.Length.ToString())
.Replace("{tteamselect}", tTeamSpawnEntities.Length.ToString());
Console.WriteLine(message);
SendGlobalChatMessage(message);
Expand Down
4 changes: 2 additions & 2 deletions src/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"entities.error.noentity": "[MapModifiers] FEHLER: Konnte Entität nicht erstellen",
"entities.created": "[MapModifiers] Entity für {type} bei {origin} mit Winkel {angle} erstellt",
"entities.deleted": "[MapModifiers] lösche Entity {type} bei {origin} mit Winkel {angle}",
"spawnpoints.count": "[MapModifiers] Spawnpunkte: {spawns}x DM, {ct}x CT, {t}x T, {ctteamselect}x CT Teamselect, {tteamselect}x T Teamselect, {ctintro}x CT-Intro, {tintro}x T-Intro für {maxplayers} Spieler.",
"spawnpoints.count": "[MapModifiers] Spawnpunkte: {spawns}x DM, {ct}x CT, {t}x T, {ctteamselect}x CT Teamselect, {tteamselect}x T Teamselect für {maxplayers} Spieler.",
"spawnpoints.countspawns.warning": "[MapModifiers] Nur {spawns} DM-Spawnpunkte, {ct} CT-Spawnpunkte und {t} T-Spawnpunkte für {maxplayers} Spieler!",
"spawnpoints.countteamspawns.warning": "[MapModifiers] Nur {ctteamselect} CT Teamselect-Spawnpunkt, {tteamselect} T Teamselect-Spawnpunkt, {ctintro} CT-Intro-Spawnpunkt, {tintro} T-Intro-Spawnpunkt!",
"spawnpoints.countteamspawns.warning": "[MapModifiers] Nur {ctteamselect} CT Teamselect-Spawnpunkt, {tteamselect} T Teamselect-Spawnpunkt!",
"spawnpoints.marker.changed": "[MapModifiers] einzelnen Spawnpunktmarker geändert",
"spawnpoints.marker.noentity": "[MapModifiers] FEHLER: Konnte Entität nicht erstellen",
"entities.onmapstart": "[MapModifiers] Überprüfe Entitäten für Karte {mapName}",
Expand Down
4 changes: 2 additions & 2 deletions src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"entities.error.noentity": "[MapModifiers] ERROR: could not spawn entity",
"entities.created": "[MapModifiers] created entity for {type} at {origin} with angle {angle}",
"entities.deleted": "[MapModifiers] deleted entity for {type} at {origin} with angle {angle}",
"spawnpoints.count": "[MapModifiers] Spawns: {spawns}x dm, {ct}x ct, {t}x t, {ctteamselect}x ct teamselect, {tteamselect}x t teamselect, {ctintro}x ct intro, {tintro}x t intro for {maxplayers} players.",
"spawnpoints.count": "[MapModifiers] Spawns: {spawns}x dm, {ct}x ct, {t}x t, {ctteamselect}x ct teamselect, {tteamselect}x t teamselect for {maxplayers} players.",
"spawnpoints.countspawns.warning": "[MapModifiers] Only {spawns} dm spawns, {ct} ct spawns and {t} t spawns for {maxplayers} players!",
"spawnpoints.countteamspawns.warning": "[MapModifiers] Only {ctteamselect} ct team select spawns, {tteamselect} t team select spawns, {ctintro} ct intro spawns, {tintro} t intro spawns!",
"spawnpoints.countteamspawns.warning": "[MapModifiers] Only {ctteamselect} ct team select spawns, {tteamselect} t team select spawns!",
"spawnpoints.marker.changed": "[MapModifiers] changed single spawn point marker",
"spawnpoints.marker.noentity": "[MapModifiers] ERROR: could not spawn entity",
"entities.onmapstart": "[MapModifiers] Checking entities for map {mapName}",
Expand Down

0 comments on commit 7cbc9a1

Please sign in to comment.