Skip to content

Instantly share code, notes, and snippets.

@Aessi
Created May 5, 2015 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Aessi/c07d9ed6ca4a68e4ad7e to your computer and use it in GitHub Desktop.
Save Aessi/c07d9ed6ca4a68e4ad7e to your computer and use it in GitHub Desktop.
MapType for lobby maps.
/**
* MapType for Melee
*
* At least one spawn
*/
#RequireContext CSmMapType
#Const Version "2014-10-07"
#Const MapTypeVersion 1
#Const ScriptName "EliteArena.Script.txt"
#Include "Libs/Nadeo/Anchor.Script.txt" as Anchor
#Include "Libs/Nadeo/MapType.Script.txt" as MapType
// ---------------------------------- //
// Functions
// ---------------------------------- //
Void UpdateValidability() {
foreach(Anchor in AnchorData) {
Anchor.Tag = Anchor.DefaultTag;
Anchor.Order = Anchor.DefaultOrder;
}
Anchor::UpdateAnchorCounts();
if (!Anchor::HasAtLeastOneAnchor("Spawn", 0, _("You must place at least one Spawn"))) return;
}
// ---------------------------------- //
// Main
// ---------------------------------- //
main() {
MapType::SetVersion(MapTypeVersion);
UpdateValidability();
while (True) {
yield;
ManialinkText = "";
foreach (Event in PendingEvents) {
if (Event.Type == CPluginEvent::Type::MapModified) {
UpdateValidability();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment