Skip to content
Permalink
Browse files

Show allowed instead of RankTooLow with allowed colour in /ztest, for…

… special affect zones.
  • Loading branch information...
UnknownShadow200 committed Jan 27, 2018
1 parent daa5cc5 commit 21f482f4302f4be5a2bfe1d2de2613312e247a68
Showing with 17 additions and 10 deletions.
  1. +17 −10 fCraft/Commands/ZoneCommands.cs
@@ -912,17 +912,24 @@ static void SignRemoveHandler(Player player, CommandReader cmd)
}

static void ZoneTestCallback( Player player, Vector3I[] marks, object tag ) {
Zone[] allowed, denied;
if( player.WorldMap.Zones.CheckDetailed( marks[0], player, out allowed, out denied ) ) {
foreach( Zone zone in allowed ) {
SecurityCheckResult status = zone.Controller.CheckDetailed( player.Info );
player.Message( "> Zone {0}&S: {1}{2}", zone.ClassyName, Color.Lime, status );
}
foreach( Zone zone in denied ) {
SecurityCheckResult status = zone.Controller.CheckDetailed( player.Info );
player.Message( "> Zone {0}&S: {1}{2}", zone.ClassyName, Color.Red, status );
Zone[] zones = player.WorldMap.Zones.Cache;
bool found = false;
for( int i = 0; i < zones.Length; i++ ) {
Zone zone = zones[i];
if( !zone.Bounds.Contains( marks[0] ) ) continue;

found = true;
SecurityCheckResult status = zone.Controller.CheckDetailed( player.Info );
if( SpecialZone.IsSpecialAffect( zone.Name ) ) {
status = SecurityCheckResult.Allowed;
}
} else {

bool allowed = status == SecurityCheckResult.Allowed || status == SecurityCheckResult.WhiteListed;
string color = allowed ? Color.Lime : Color.Red;
player.Message( "> Zone {0}&S: {1}{2}", zone.ClassyName, color, status );
}

if( !found ) {
player.Message( "No zones affect this block." );
}
}

0 comments on commit 21f482f

Please sign in to comment.
You can’t perform that action at this time.