Skip to content

Commit

Permalink
feat: de_vertigo
Browse files Browse the repository at this point in the history
  • Loading branch information
oscar-wos committed Nov 15, 2024
1 parent facecd3 commit 1bbeb57
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 5 deletions.
54 changes: 54 additions & 0 deletions config/de_vertigo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"a": [
{
"type": 1,
"teams": [ 2, 3 ],
"x": [ -1459.2844, -488.7206, 11654.846 ],
"y": [ -1605.6305, -509.01038, 11451.8125 ]
},
{
"type": 1,
"teams": [ 2, 3 ],
"x": [ -1783.0804, -501.0356, 11514.864 ],
"y": [ -1797.9127, -565.49445, 11617.141 ]
},
{
"type": 1,
"teams": [ 2, 3 ],
"x": [ -1664.0762, -375.0846, 11731.386 ],
"y": [ -1636.3165, -545.94794, 11918.659 ]
},
{
"type": 1,
"teams": [ 2, 3 ],
"x": [ -1585.8986, 499.92847, 11981.862 ],
"y": [ -1374.3403, 537.29474, 11836.88 ]
},
{
"type": 1,
"teams": [ 2, 3 ],
"x": [ -1317.8094, 987.68976, 11740.612 ],
"y": [ -1345.924, 855.7326, 11899.488 ]
}
],
"b": [
{
"type": 1,
"teams": [ 2, 3 ],
"x": [ -1293.5146, 4.612604, 11573.785 ],
"y": [ -1257.5859, -162.91309, 11454.758 ]
},
{
"type": 1,
"teams": [ 2, 3 ],
"x": [ -893.4085, 72.37798, 11913.366 ],
"y": [ -1067.1519, 55.76521, 11738.108 ]
},
{
"type": 1,
"teams": [ 2, 3 ],
"x": [ -665.91003, 520.5073, 11880.517 ],
"y": [ -786.40344, 528.09564, 11729.007 ]
}
]
}
Binary file added config/de_vertigo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Zone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ public class Zone(Bombsite bombsite, ZoneType type, CsTeam[] teams, float[] minP

public bool IsInZone(Vector point)
{
return point.X >= MinPoint[0] && point.X <= MaxPoint[0] && point.Y >= MinPoint[1] && point.Y <= MaxPoint[1] && point.Z >= MinPoint[2] && point.Z <= MaxPoint[2];
return point.X >= MinPoint[0] && point.X <= MaxPoint[0] && point.Y >= MinPoint[1] && point.Y <= MaxPoint[1] && point.Z + 36 >= MinPoint[2] && point.Z + 36 <= MaxPoint[2];
}
}
17 changes: 13 additions & 4 deletions src/Zones.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ public override void Load(bool isReload)
RegisterListener<Listeners.OnClientPutInServer>(OnClientPutInServer);
RegisterListener<Listeners.OnClientDisconnect>(OnClientDisconnect);

if (!isReload)
return;

LoadJson(Server.MapName);
if (isReload)
ReloadPlugin();
}

public override void OnAllPluginsLoaded(bool isReload)
Expand All @@ -27,4 +25,15 @@ public override void Unload(bool isReload)
{
RetakesPluginEventSenderCapability.Get()!.RetakesPluginEventHandlers -= OnRetakesEvent;
}

private void ReloadPlugin()
{
LoadJson(Server.MapName);

Server.NextFrame(() =>
{
foreach (var controller in Utilities.GetPlayers().Where(c => c is { IsValid: true }))
_playerData[controller] = new PlayerData();
});
}
}

0 comments on commit 1bbeb57

Please sign in to comment.