Skip to content
Permalink
Browse files

Revert "Make navmesh connection editing a little easier."

This reverts commit 726b17a.

Fuma said:

> you can just revert the change, since the code is so buggy as to be ineffective
  • Loading branch information...
illwieckz committed Mar 10, 2019
1 parent ef4565c commit 0805995a47c035a74749fb735e58410aa35681cb
Showing with 3 additions and 34 deletions.
  1. +3 −34 src/engine/botlib/bot_nav_edit.cpp
@@ -45,7 +45,6 @@ Maryland 20850 USA.
#include "nav.h"

static const int DEFAULT_CONNECTION_SIZE = 50;
static int connectionSize = DEFAULT_CONNECTION_SIZE;

bool GetPointPointedTo( NavData_t *nav, rVec &p )
{
@@ -93,13 +92,13 @@ void BotDrawNavEdit( DebugDrawQuake *dd )
{
unsigned int col = duRGBA( 255, 255, 255, 220 );
dd->begin( DU_DRAW_LINES, 2.0f );
duAppendCircle( dd, p[ 0 ], p[ 1 ], p[ 2 ], connectionSize, col );
duAppendCircle( dd, p[ 0 ], p[ 1 ], p[ 2 ], DEFAULT_CONNECTION_SIZE, col );

if ( cmd.offBegin )
{
duAppendArc( dd, cmd.pc.start[ 0 ], cmd.pc.start[ 1 ], cmd.pc.start[ 2 ], p[ 0 ], p[ 1 ], p[ 2 ], 0.25f,
0.6f, 0.6f, col );
duAppendCircle( dd, cmd.pc.start[ 0 ], cmd.pc.start[ 1 ], cmd.pc.start[ 2 ], connectionSize, col );
duAppendCircle( dd, cmd.pc.start[ 0 ], cmd.pc.start[ 1 ], cmd.pc.start[ 2 ], DEFAULT_CONNECTION_SIZE, col );
}
dd->end();
}
@@ -298,7 +297,7 @@ void Cmd_AddConnection()
}
else
{
cmd.pc.radius = connectionSize;
cmd.pc.radius = DEFAULT_CONNECTION_SIZE;
}
cmd.offBegin = true;
}
@@ -345,36 +344,6 @@ void Cmd_AddConnection()
}
}

static void adjustConnectionSize( int dir )
{
int argc = Cmd_Argc();
int adjust = 5;
int newConnectionSize;

if ( argc > 1 )
{
adjust = Math::Clamp( atoi( Cmd_Argv( 1 ) ), 1, 20 );
}

newConnectionSize = Math::Clamp( connectionSize + dir * adjust, 20, 100 );

if ( newConnectionSize != connectionSize )
{
connectionSize = newConnectionSize;
Log::Notice( "Default connection size = %d", connectionSize );
}
}

void Cmd_ConnectionSizeUp()
{
return adjustConnectionSize( 1 );
}

void Cmd_ConnectionSizeDown()
{
return adjustConnectionSize( -1 );
}

void Cmd_NavTest()
{
const char usage[] = "Usage: navtest shownodes/hidenodes/showportals/hideportals/startpath/endpath";

0 comments on commit 0805995

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